Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sverraest authored Mar 22, 2021
1 parent ee0a052 commit ffe8a8c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,29 @@ die();
```


#### Create transaction without a payment method with your own localId that will redirect to the payment method selection screen and also sends a webhook for this specific transaction. Furthermore expire this payment link automatically after 3 hours.

```php
use PomeloPayConnect\Client;

// Get your API Key and App ID from the "Connect" screen on your merchant dashboard
$client = new Client('apikey', 'appid');

// Currency should be your merchant account currency or the payment would be rejected
$json = [
"currency" => "EUR",
"amount" => 1234, // 12.34 EUR,
"validForHours" => 3,
"localId" => "INVOICE-2020-0001",
"webhook" => "https://foo.bar/incoming/1234",
"redirectUrl" => "https://your.webshop.domain.url/my_order/2020_0001" // Optional redirect after payment completion, the payment portal will redirect to this URL and attach queryParameters to this URL, fully optional
];

$transaction = $client->transactions->create($json);
header('Location: '. $transaction->url); // Go to payment screen on Pomelo Pay
die();
```



## About
Expand Down

0 comments on commit ffe8a8c

Please sign in to comment.