Skip to content

Commit 3771915

Browse files
committed
Introduces a possibility to set redirect_url parameter within a checkout
1 parent 0d9aa0d commit 3771915

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "SumUp eCom SDK for PHP",
44
"type": "library",
55
"license": "proprietary",
6-
"version": "1.1.0",
6+
"version": "1.2.0",
77
"keywords": ["sumup", "sdk", "payment processing", "ecommerce", "payment", "checkout"],
88
"homepage": "https://developer.sumup.com",
99
"authors": [

src/SumUp/Services/Checkouts.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public function __construct(SumUpHttpClientInterface $client, AccessToken $acces
5151
* @param string $description
5252
* @param null $payFromEmail
5353
* @param null $returnURL
54+
* @param null $redirectURL
5455
*
5556
* @return \SumUp\HttpClients\Response
5657
*
@@ -60,7 +61,7 @@ public function __construct(SumUpHttpClientInterface $client, AccessToken $acces
6061
* @throws \SumUp\Exceptions\SumUpAuthenticationException
6162
* @throws \SumUp\Exceptions\SumUpSDKException
6263
*/
63-
public function create($amount, $currency, $checkoutRef, $payToEmail, $description = '', $payFromEmail = null, $returnURL = null)
64+
public function create($amount, $currency, $checkoutRef, $payToEmail, $description = '', $payFromEmail = null, $returnURL = null, $redirectURL = null)
6465
{
6566
if (empty($amount) || !is_numeric($amount)) {
6667
throw new SumUpArgumentException(ExceptionMessages::getMissingParamMsg('amount'));
@@ -87,6 +88,9 @@ public function create($amount, $currency, $checkoutRef, $payToEmail, $descripti
8788
if (isset($returnURL)) {
8889
$payload['return_url'] = $returnURL;
8990
}
91+
if (isset($redirectURL)) {
92+
$payload['redirect_url'] = $redirectURL;
93+
}
9094
$path = '/v0.1/checkouts';
9195
$headers = array_merge(Headers::getStandardHeaders(), Headers::getAuth($this->accessToken));
9296
return $this->client->send( 'POST', $path, $payload, $headers);

0 commit comments

Comments
 (0)