-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds request and get
payment contexts
endpoints (#229)
- Loading branch information
1 parent
9e606ac
commit 69e8b8f
Showing
21 changed files
with
607 additions
and
3 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
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
21 changes: 21 additions & 0 deletions
21
lib/Checkout/Payments/Contexts/PaymentContextsAirlineData.php
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 | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
class PaymentContextsAirlineData | ||
{ | ||
/** | ||
* @var array of Checkout\Payments\Contexts\PaymentContextsTicket | ||
*/ | ||
public $tickets; | ||
|
||
/** | ||
* @var array of Checkout\Payments\Contexts\PaymentContextsPassenger | ||
*/ | ||
public $passengers; | ||
|
||
/** | ||
* @var array of Checkout\Payments\Contexts\PaymentContextsFlightLegDetails | ||
*/ | ||
public $flight_leg_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,41 @@ | ||
<?php | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
use Checkout\ApiClient; | ||
use Checkout\AuthorizationType; | ||
use Checkout\CheckoutApiException; | ||
use Checkout\CheckoutConfiguration; | ||
use Checkout\Client; | ||
|
||
class PaymentContextsClient extends Client | ||
{ | ||
|
||
const PAYMENT_CONTEXTS = "payment-contexts"; | ||
|
||
public function __construct(ApiClient $apiClient, CheckoutConfiguration $configuration) | ||
{ | ||
parent::__construct($apiClient, $configuration, AuthorizationType::$secretKeyOrOAuth); | ||
} | ||
|
||
/** | ||
* @param PaymentContextsRequest $paymentContextsRequest | ||
* @return array | ||
* @throws CheckoutApiException | ||
*/ | ||
public function createPaymentContexts(PaymentContextsRequest $paymentContextsRequest) | ||
{ | ||
return $this->apiClient->post(self::PAYMENT_CONTEXTS, $paymentContextsRequest, $this->sdkAuthorization()); | ||
} | ||
|
||
/** | ||
* @param $id | ||
* @return array | ||
* @throws CheckoutApiException | ||
*/ | ||
public function getPaymentContextDetails($id) | ||
{ | ||
return $this->apiClient->get($this->buildPath(self::PAYMENT_CONTEXTS, $id), $this->sdkAuthorization()); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
lib/Checkout/Payments/Contexts/PaymentContextsFlightLegDetails.php
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,51 @@ | ||
<?php | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
class PaymentContextsFlightLegDetails | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $flight_number; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $carrier_code; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $class_of_travelling; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $departure_airport; | ||
|
||
/** | ||
* @var DateTime | ||
*/ | ||
public $departure_date; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $departure_time; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $arrival_airport; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $stop_over_code; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $fare_basis_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
class PaymentContextsItems | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $quantity; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $unit_price; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $reference; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $total_amount; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $tax_amount; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $discount_amount; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $url; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $image_url; | ||
} |
16 changes: 16 additions & 0 deletions
16
lib/Checkout/Payments/Contexts/PaymentContextsPartnerCustomerRiskData.php
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 | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
class PaymentContextsPartnerCustomerRiskData | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $key; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $value; | ||
} |
28 changes: 28 additions & 0 deletions
28
lib/Checkout/Payments/Contexts/PaymentContextsPassenger.php
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,28 @@ | ||
<?php | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
use Checkout\Common\Address; | ||
|
||
class PaymentContextsPassenger | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $first_name; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $last_name; | ||
|
||
/** | ||
* @var DateTime | ||
*/ | ||
public $date_of_birth; | ||
|
||
/** | ||
* @var Address | ||
*/ | ||
public $address; | ||
} |
51 changes: 51 additions & 0 deletions
51
lib/Checkout/Payments/Contexts/PaymentContextsProcessing.php
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,51 @@ | ||
<?php | ||
|
||
namespace Checkout\Payments\Contexts; | ||
|
||
class PaymentContextsProcessing | ||
{ | ||
/** | ||
* @var string value of BillingPlan | ||
*/ | ||
public $billing_plan; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
public $shipping_amount; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $invoice_id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $brand_name; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $locale; | ||
|
||
/** | ||
* @var string value of ShippingPreference | ||
*/ | ||
public $shipping_preference; | ||
|
||
/** | ||
* @var string value of UserAction | ||
*/ | ||
public $user_action; | ||
|
||
/** | ||
* @var string value of PaymentContextsPartnerCustomerRiskData | ||
*/ | ||
public $partner_customer_risk_data; | ||
|
||
/** | ||
* @var array of Checkout\Payments\Contexts\PaymentContextsAirlineData | ||
*/ | ||
public $airline_data; | ||
} |
Oops, something went wrong.