-
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.
add bizum payment method for direct payments
- Loading branch information
Showing
67 changed files
with
4,418 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,30 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App; | ||
|
||
use Articus\DataTransfer as DT; | ||
use Interop\Container\ContainerInterface; | ||
use OpenAPIGenerator\APIClient as OAGAC; | ||
|
||
class ApiClientFactory extends DT\ConfigAwareFactory | ||
{ | ||
public function __construct(string $configKey = ApiClient::class) | ||
{ | ||
parent::__construct($configKey); | ||
} | ||
|
||
public function __invoke(ContainerInterface $container, $requestedName, array $options = null) | ||
{ | ||
$config = new OAGAC\ApiClientOptions(\array_merge($this->getServiceConfig($container), $options ?? [])); | ||
return new ApiClient( | ||
$config->serverUrl, | ||
$container->get($config->dataTransferServiceName), | ||
$container->get($config->requestFactoryServiceName), | ||
$container->get($config->httpClientServiceName), | ||
$container->get($config->securityProviderFactoryServiceName), | ||
$container->get($config->bodyCoderFactoryServiceName), | ||
$container->get($config->bodyCoderFactoryServiceName) | ||
); | ||
} | ||
} |
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,68 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class ActivateSubscriptionRequest | ||
{ | ||
/** | ||
* A payment token generated by monei.js [Components](https://docs.monei.com/docs/monei-js-overview) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/docs/save-payment-method). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place. | ||
* @DTA\Data(field="paymentToken", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $payment_token; | ||
|
||
/** | ||
* A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend. | ||
* @DTA\Data(field="sessionId", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $session_id; | ||
|
||
/** | ||
* The amount to be added to the subscription's initial payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD). | ||
* @DTA\Data(field="addAmount", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"int"}) | ||
* @var int|null | ||
*/ | ||
public $add_amount; | ||
|
||
/** | ||
* A permanent identifier that refers to the initial payment of a sequence of payments. This value needs to be sent in the path for `RECURRING` payments. | ||
* @DTA\Data(field="sequenceId", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $sequence_id; | ||
|
||
/** | ||
* The URL the customer will be directed to after transaction completed (successful or failed - except if `failUrl` is provided). | ||
* @DTA\Data(field="completeUrl", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $complete_url; | ||
|
||
/** | ||
* The URL the customer will be directed to after transaction has failed, instead of `completeUrl` (used in hosted payment page). This allows to provide two different URLs for successful and failed payments. | ||
* @DTA\Data(field="failUrl", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $fail_url; | ||
|
||
/** | ||
* The URL the customer will be directed to if they decide to cancel payment and return to your website (used in hosted payment page). | ||
* @DTA\Data(field="cancelUrl", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $cancel_url; | ||
|
||
} |
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,60 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class Address | ||
{ | ||
/** | ||
* Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). | ||
* @DTA\Data(field="country", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $country; | ||
|
||
/** | ||
* City, district, suburb, town, or village. | ||
* @DTA\Data(field="city", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $city; | ||
|
||
/** | ||
* Address line 1 (e.g., street, PO Box, or company name). | ||
* @DTA\Data(field="line1", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $line1; | ||
|
||
/** | ||
* Address line 2 (e.g., apartment, suite, unit, or building). | ||
* @DTA\Data(field="line2", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $line2; | ||
|
||
/** | ||
* ZIP or postal code. | ||
* @DTA\Data(field="zip", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $zip; | ||
|
||
/** | ||
* State, county, province, or region. | ||
* @DTA\Data(field="state", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $state; | ||
|
||
} |
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,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class CancelPaymentRequest | ||
{ | ||
/** | ||
* @DTA\Data(field="cancellationReason", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\PaymentCancellationReason::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\PaymentCancellationReason::class}) | ||
* @var \App\DTO\PaymentCancellationReason|null | ||
*/ | ||
public $cancellation_reason; | ||
|
||
} |
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,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class CancelSubscriptionRequest | ||
{ | ||
/** | ||
* If true, the subscription will be canceled at the end of the current period. | ||
* @DTA\Data(field="cancelAtPeriodEnd", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"bool"}) | ||
* @var bool|null | ||
*/ | ||
public $cancel_at_period_end; | ||
|
||
} |
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,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class CapturePaymentRequest | ||
{ | ||
/** | ||
* The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. | ||
* @DTA\Data(field="amount", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"int"}) | ||
* @var int|null | ||
*/ | ||
public $amount; | ||
|
||
} |
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,16 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
* @DTA\Strategy(name="ScalarList", options={"type":"string"}) | ||
* @DTA\Validator(name="Collection", options={"validators":{ | ||
* {"name":"Scalar", "options":{"type":"string"}} | ||
* }}) | ||
*/ | ||
class Collection extends \ArrayObject | ||
{ | ||
} |
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,60 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
*/ | ||
class ConfirmPaymentRequest | ||
{ | ||
/** | ||
* A payment token generated by monei.js [Components](https://docs.monei.com/docs/monei-js-overview) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/docs/save-payment-method). | ||
* @DTA\Data(field="paymentToken") | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $payment_token; | ||
|
||
/** | ||
* @DTA\Data(field="paymentMethod", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\ConfirmPaymentRequestPaymentMethod::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\ConfirmPaymentRequestPaymentMethod::class}) | ||
* @var \App\DTO\ConfirmPaymentRequestPaymentMethod|null | ||
*/ | ||
public $payment_method; | ||
|
||
/** | ||
* If set to true a permanent token that represents a payment method used in the payment will be generated. | ||
* @DTA\Data(field="generatePaymentToken", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"bool"}) | ||
* @var bool|null | ||
*/ | ||
public $generate_payment_token; | ||
|
||
/** | ||
* @DTA\Data(field="customer", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\PaymentCustomer::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\PaymentCustomer::class}) | ||
* @var \App\DTO\PaymentCustomer|null | ||
*/ | ||
public $customer; | ||
|
||
/** | ||
* @DTA\Data(field="billingDetails", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\PaymentBillingDetails::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\PaymentBillingDetails::class}) | ||
* @var \App\DTO\PaymentBillingDetails|null | ||
*/ | ||
public $billing_details; | ||
|
||
/** | ||
* @DTA\Data(field="shippingDetails", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\PaymentShippingDetails::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\PaymentShippingDetails::class}) | ||
* @var \App\DTO\PaymentShippingDetails|null | ||
*/ | ||
public $shipping_details; | ||
|
||
} |
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,21 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
* Additional information about the payment method used for this payment. | ||
*/ | ||
class ConfirmPaymentRequestPaymentMethod | ||
{ | ||
/** | ||
* @DTA\Data(field="card", nullable=true) | ||
* @DTA\Strategy(name="Object", options={"type":\App\DTO\ConfirmPaymentRequestPaymentMethodCard::class}) | ||
* @DTA\Validator(name="TypeCompliant", options={"type":\App\DTO\ConfirmPaymentRequestPaymentMethodCard::class}) | ||
* @var \App\DTO\ConfirmPaymentRequestPaymentMethodCard|null | ||
*/ | ||
public $card; | ||
|
||
} |
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,29 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace App\DTO; | ||
|
||
use Articus\DataTransfer\Annotation as DTA; | ||
|
||
/** | ||
* Additional information about the card used for this payment. | ||
*/ | ||
class ConfirmPaymentRequestPaymentMethodCard | ||
{ | ||
/** | ||
* The cardholder's name, as stated in the credit card. | ||
* @DTA\Data(field="cardholderName", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $cardholder_name; | ||
|
||
/** | ||
* The cardholder's email address. | ||
* @DTA\Data(field="cardholderEmail", nullable=true) | ||
* @DTA\Validator(name="Scalar", options={"type":"string"}) | ||
* @var string|null | ||
*/ | ||
public $cardholder_email; | ||
|
||
} |
Oops, something went wrong.