-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from flowwow/FB-1722
FB-1722 add sbp payment
- Loading branch information
Showing
8 changed files
with
139 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace Flowwow\Cloudpayments\Request; | ||
|
||
use Flowwow\Cloudpayments\BaseRequest; | ||
use Flowwow\Cloudpayments\Exceptions\BadTypeException; | ||
|
||
/** | ||
* Class PaymentsSbp | ||
* @see https://developers.cloudpayments.ru/#sbp | ||
* | ||
*/ | ||
abstract class PaymentsSbp extends BaseRequest | ||
{ | ||
/** | ||
* @var int|float | ||
*/ | ||
public $amount; | ||
public string $currency; | ||
public string $description; | ||
public string $scheme; | ||
public ?string $accountId; | ||
public ?string $email; | ||
public ?string $jsonData; | ||
public ?string $invoiceId; | ||
public ?string $ipAddress; | ||
public ?string $successRedirectUrl; | ||
public ?string $failRedirectUrl; | ||
public ?int $ttlMinutes; | ||
|
||
/** | ||
* PaymentsSbpLink constructor. | ||
* @param $amount | ||
* @param string $currency | ||
* @param string $description | ||
* @throws BadTypeException | ||
*/ | ||
public function __construct($amount, string $currency, string $description) | ||
{ | ||
if (!is_numeric($amount)) { | ||
throw new BadTypeException('Amount isn\'t numeric'); | ||
} | ||
$this->amount = $amount; | ||
$this->currency = $currency; | ||
$this->description = $description; | ||
$this->scheme = 'charge'; | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace Flowwow\Cloudpayments\Request; | ||
|
||
/** | ||
* Class PaymentsSbpLink | ||
* @package Flowwow\Cloudpayments\CardPayment | ||
* @see https://developers.cloudpayments.ru/#sbp-poluchenie-ssylki-dlya-oplaty | ||
* | ||
*/ | ||
class PaymentsSbpLink extends PaymentsSbp | ||
{ | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace Flowwow\Cloudpayments\Request; | ||
|
||
/** | ||
* Class PaymentsSbpQr | ||
* @package Flowwow\Cloudpayments\CardPayment | ||
* @see https://developers.cloudpayments.ru/#sbp-poluchenie-qr-koda-dlya-oplaty | ||
* | ||
*/ | ||
class PaymentsSbpQr extends PaymentsSbp | ||
{ | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace Flowwow\Cloudpayments\Response\Models; | ||
|
||
/** | ||
* Class SbpBankModel | ||
* @package Flowwow\Cloudpayments\Response\Models | ||
*/ | ||
class SbpBankModel extends BaseModel | ||
{ | ||
public ?string $bankName = null; | ||
public ?string $logoURL = null; | ||
public ?string $schema = null; | ||
public ?string $currency = null; | ||
public ?string $package_name = null; | ||
public ?string $webClientUrl = null; | ||
public ?bool $isWebClientActive = null; | ||
} |
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