-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ff19b7
commit 3abdc21
Showing
8 changed files
with
49 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,35 +8,45 @@ | |
use Webmozart\Assert\Assert; | ||
|
||
/** | ||
* Class VposRequest. | ||
* Class CardRequest. | ||
* | ||
* @author bernard-ng <[email protected]> | ||
*/ | ||
final class VposRequest extends Request | ||
final class CardRequest extends Request | ||
{ | ||
public function __construct( | ||
float $amount, | ||
string $reference, | ||
Currency $currency, | ||
string $description, | ||
string $callbackUrl, | ||
public readonly ?string $homeUrl, | ||
?string $description = null, | ||
?string $approveUrl = null, | ||
?string $cancelUrl = null, | ||
?string $declineUrl = null | ||
string $approveUrl, | ||
string $cancelUrl, | ||
string $declineUrl, | ||
public string $homeUrl, | ||
) { | ||
Assert::notEmpty($description, 'The description must be provided'); | ||
Assert::notEmpty($approveUrl, 'The approve url must be provided'); | ||
Assert::notEmpty($cancelUrl, 'The cancel url must be provided'); | ||
Assert::notEmpty($declineUrl, 'The decline url must be provided'); | ||
Assert::notEmpty($homeUrl, 'The home url must be provided'); | ||
Assert::lengthBetween($reference, 1, 25, 'The reference must be between 1 and 25 characters'); | ||
|
||
parent::__construct($amount, $reference, $currency, $callbackUrl, $approveUrl, $description, $cancelUrl, $declineUrl); | ||
} | ||
|
||
/** | ||
* Yeah, I know this is weird | ||
* But I'm not responsible for the API design. | ||
* so don't blame :D | ||
*/ | ||
#[\Override] | ||
public function getPayload(): array | ||
{ | ||
return [ | ||
'amount' => $this->amount, | ||
'merchant' => $this->merchant, | ||
'authorization' => $this->authorization, | ||
'authorization' => sprintf('Bearer %s', $this->authorization), | ||
'reference' => $this->reference, | ||
'currency' => $this->currency->value, | ||
'callback_url' => $this->callbackUrl, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,11 +7,11 @@ | |
use Devscast\Flexpay\Data\Status; | ||
|
||
/** | ||
* Class VposResponse. | ||
* Class CardResponse. | ||
* | ||
* @author bernard-ng <[email protected]> | ||
*/ | ||
final class VposResponse extends FlexpayResponse | ||
final class CardResponse extends FlexpayResponse | ||
{ | ||
public function __construct( | ||
public Status $code, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"code": 0, | ||
"message": "Redirection en cours", | ||
"orderNumber": "O42iABI27568020268434827", | ||
"url": "https://gwvisa.flexpay.cd/checkout/bbba6b699af8a70e9cfa010d6d12dba5_670d206b7defb" | ||
} |
This file was deleted.
Oops, something went wrong.