Skip to content

Commit

Permalink
Merge tag '1.3.18' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumbertin committed Jan 29, 2025
2 parents ad0b170 + aa9ea65 commit eb002ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
42 changes: 0 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,50 +13,8 @@ composer require paygreen/paygreen-php
- PHP 5.6 and above.
- [PSR-18](https://www.php-fig.org/psr/psr-18/) HTTP Client like [Guzzle](https://github.com/guzzle/guzzle) or [curl-client](https://github.com/php-http/curl-client)


### Example

```php
use Http\Client\Curl\Client;
use Paygreen\Sdk\Payment\V2\PaymentClient;

$environment = new Environment('YOUR_PUBLIC_KEY', 'YOUR_PRIVATE_KEY', 'SANDBOX', 2);

$client = new PaymentClient(new Client(), $environment);

$customer = new Paygreen\Sdk\Payment\V2\Model\Customer();
$customer->setId('my-customer-id');
$customer->setEmail('[email protected]');
// ... and setStreetLineOne, setLastName

$shippingAddress = new Paygreen\Sdk\Payment\V2\Model\Address();
$shippingAddress->setCity('London');
// ... and setStreetLineOne, setCountryCode, setPostcode

$billingAddress = new Paygreen\Sdk\Payment\V2\Model\Address();
$billingAddress->setCity('London');
// ... and setStreetLineOne, setCountryCode, setPostcode

$order = new Paygreen\Sdk\Payment\V2\Model\Order();
$order->setCustomer($customer);
$order->setBillingAddress($billingAddress);
$order->setShippingAddress($shippingAddress);
$order->setReference('my-order-reference');
$order->setAmount(2650);
$order->setCurrency('EUR');

$paymentOrder = new Paygreen\Sdk\Payment\V2\Model\PaymentOrder();
$paymentOrder->setType('CASH');
$paymentOrder->setOrder($order);
$paymentOrder->setNotifiedUrl('https://localhost/notify');

$response = $paymentClient->createCashPayment($paymentOrder);
```

## 📚 Documentation

See the [docs](https://github.com/PayGreen/paygreen-php/blob/master/docs/v2/README.md).

> 🚀 Find the documentation for Paygreen V3 [here](https://github.com/PayGreen/paygreen-php/tree/master/docs/v3).
## 🚧 Testing
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paygreen/paygreen-php",
"version": "1.3.17",
"version": "1.3.18",
"description": "PayGreen PHP SDK",
"type": "library",
"license": "proprietary",
Expand Down

0 comments on commit eb002ed

Please sign in to comment.