From 671a1af8ff8c9eae04aad15fcd201ce54bd489e9 Mon Sep 17 00:00:00 2001 From: Armando Ibarra Date: Wed, 3 Aug 2022 00:20:03 -0500 Subject: [PATCH] Added support to ACH and Level 2 & 3 fields Added Palestine Country code API Updates: Payments --- lib/Checkout/Common/Country.php | 1 + lib/Checkout/Common/PaymentSourceType.php | 4 ++ lib/Checkout/Payments/CaptureRequest.php | 37 +++++++++++++++ .../Payments/PaymentCustomerRequest.php | 13 ++++++ lib/Checkout/Payments/ProcessingSettings.php | 40 +++++++++++++---- lib/Checkout/Payments/Product.php | 16 ++++--- .../Source/Apm/RequestAlipayPlusCNSource.php | 14 ------ .../Apm/RequestAlipayPlusGCashSource.php | 14 ------ .../Source/Apm/RequestAlipayPlusHKSource.php | 14 ------ .../Source/Apm/RequestAlipayPlusSource.php | 45 +++++++++++++++++++ .../Request/Source/RequestIdSource.php | 5 +++ lib/Checkout/Payments/ShippingDetails.php | 5 +++ .../RequestApmPaymentsIntegrationTest.php | 26 +++++++++++ 13 files changed, 178 insertions(+), 56 deletions(-) create mode 100644 lib/Checkout/Payments/PaymentCustomerRequest.php delete mode 100644 lib/Checkout/Payments/Request/Source/Apm/RequestAlipayPlusCNSource.php delete mode 100644 lib/Checkout/Payments/Request/Source/Apm/RequestAlipayPlusGCashSource.php delete mode 100644 lib/Checkout/Payments/Request/Source/Apm/RequestAlipayPlusHKSource.php create mode 100644 lib/Checkout/Payments/Request/Source/Apm/RequestAlipayPlusSource.php diff --git a/lib/Checkout/Common/Country.php b/lib/Checkout/Common/Country.php index b4ed09f5..4ea4137b 100644 --- a/lib/Checkout/Common/Country.php +++ b/lib/Checkout/Common/Country.php @@ -255,4 +255,5 @@ final class Country public static $YE = "YE"; public static $ZM = "ZM"; public static $ZW = "ZW"; + public static $PS = "PS"; } diff --git a/lib/Checkout/Common/PaymentSourceType.php b/lib/Checkout/Common/PaymentSourceType.php index 07928508..f1c5b848 100644 --- a/lib/Checkout/Common/PaymentSourceType.php +++ b/lib/Checkout/Common/PaymentSourceType.php @@ -38,4 +38,8 @@ class PaymentSourceType public static $alipay_cn = "alipay_cn"; public static $gcash = "gcash"; public static $wechatpay = "wechatpay"; + public static $dana = "dana"; + public static $kakaopay = "kakaopay"; + public static $truemoney = "truemoney"; + public static $tng = "tng"; } diff --git a/lib/Checkout/Payments/CaptureRequest.php b/lib/Checkout/Payments/CaptureRequest.php index bdb1cde7..2671b77d 100644 --- a/lib/Checkout/Payments/CaptureRequest.php +++ b/lib/Checkout/Payments/CaptureRequest.php @@ -2,6 +2,8 @@ namespace Checkout\Payments; +use Checkout\Common\MarketplaceData; + class CaptureRequest { /** @@ -19,6 +21,41 @@ class CaptureRequest */ public $reference; + /** + * @var PaymentCustomerRequest + */ + public $customer; + + /** + * @var string + */ + public $description; + + /** + * @var BillingDescriptor + */ + public $billing_descriptor; + + /** + * @var ShippingDetails + */ + public $shipping; + + /** + * @var array of Checkout\Payments\Product + */ + public $items; + + /** + * @var MarketplaceData + */ + public $marketplace; + + /** + * @var ProcessingSettings + */ + public $processing; + /** * @var array */ diff --git a/lib/Checkout/Payments/PaymentCustomerRequest.php b/lib/Checkout/Payments/PaymentCustomerRequest.php new file mode 100644 index 00000000..b9980620 --- /dev/null +++ b/lib/Checkout/Payments/PaymentCustomerRequest.php @@ -0,0 +1,13 @@ +reference = $this->randomEmail(); + $paymentRequest->source = $requestSource; + $paymentRequest->capture = true; + $paymentRequest->amount = 1000; + $paymentRequest->currency = Currency::$EUR; + $paymentRequest->success_url = "https://testing.checkout.com/sucess"; + $paymentRequest->failure_url = "https://testing.checkout.com/failure"; + + try { + $this->checkoutApi->getPaymentsClient()->requestPayment($paymentRequest); + } catch (Exception $ex) { + self::assertTrue($ex instanceof CheckoutApiException); + } + } + /** * @test */