trollweb / afterpay-api
Swagger generated api library for https://developer.afterpay.io/api
2.1.1
2020-09-23 10:30 UTC
Requires
- php: >=5.4
- ext-curl: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- friendsofphp/php-cs-fixer: ~1.12
- phpunit/phpunit: ~4.8
- satooshi/php-coveralls: ~1.0
- squizlabs/php_codesniffer: ~2.6
README
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
This PHP package is automatically generated by the Swagger Codegen project:
- API version: v3
- Build package: io.swagger.codegen.languages.PhpClientCodegen
Requirements
PHP 5.4.0 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/afterpay-api/afterpay-api-lib.git"
}
],
"require": {
"afterpay-api/afterpay-api-lib": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/SwaggerClient-php/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Trollweb\AfterPayApi\Api\CheckoutApi();
$request = new \Trollweb\AfterPayApi\Model\AuthorizePaymentRequest(); // \Trollweb\AfterPayApi\Model\AuthorizePaymentRequest |
try {
$result = $api_instance->checkoutAuthorizePayment($request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CheckoutApi->checkoutAuthorizePayment: ', $e->getMessage(), PHP_EOL;
}
?>
Documentation for API Endpoints
All URIs are relative to https://api.afterpay.io
Class | Method | HTTP request | Description |
---|---|---|---|
CheckoutApi | checkoutAuthorizePayment | POST /api/v3/checkout/authorize | Approves the payment for a specified customer and basket. Main use-cases are One-Step and Two-Step Authorization. Full fraud and credit scoring applied. If the online-shop customer enter the incorrect address data, the system delivers a suggestion for a corrected address. |
CheckoutApi | checkoutAvailablePaymentMethods | POST /api/v3/checkout/payment-methods | Returns the available payment methods for a specified basket value and offers available for client. Returns monthly installment amount, interest and fees. Sending in customer data and contents of the basket to enhance the result is optional. If the online-shop customer enters the incorrect address data, the system delivers suggestion for a corrected address. Main use-case is Two-Step Authorize. |
CheckoutApi | checkoutCreateContract | POST /api/v3/checkout/{checkoutId}/contract | Creates an installment and/or direct debit contract that can be displayed for the customer. |
CommonApi | commonCustomerLookup | POST /api/v3/lookup/customer | Returns the customers address based on social security number or mobile number. |
CommonApi | commonGetStatus | GET /api/v3/status | Gets the status of the service |
CommonApi | commonGetVersion | GET /api/v3/version | Gets the version of the service |
CommonApi | commonValidateAddress | POST /api/v3/validate/address | Check of the delivered customer addresses as well as a phonetic and associative identification of duplicates. Additionally, checks of client specific negative or positive lists can be processed. Usually, the AddressCheck is used for the pure verification of the address data e.g. for registration processes. |
CommonApi | commonValidateBankAccount | POST /api/v3/validate/bank-account | Validates and evaluates the account and bank details in the context of direct debit payment. It is possible to transfer either the combination of BankCode and AccountNumber or IBAN and BIC |
CustomerAccountApi | customerAccountAddEvent | POST /api/v3/customer-account/{accountNumber}/event | Add event to account |
CustomerAccountApi | customerAccountAddTransaction | POST /api/v3/customer-account/{accountNumber}/transaction | Add transaction to account |
CustomerAccountApi | customerAccountApplyForCredit | POST /api/v3/customer-account | Apply for customer account credit |
CustomerAccountApi | customerAccountCreateUser | POST /api/v3/customer-account/{accountNumber}/user | Add user to account |
CustomerAccountApi | customerAccountCreditLimit | GET /api/v3/customer-account/{accountNumber}/credit-limit | Get remaining account credit limit |
CustomerAccountApi | customerAccountDeleteTransaction | DELETE /api/v3/customer-account/{accountNumber}/transaction/{transactionId} | Cancels transaction made by account |
CustomerAccountApi | customerAccountLookupBySSN | GET /api/v3/customer-account/{ssn} | Find customer account by SSN (social security number) |
OrderManagementApi | orderManagementAddShippingDetails | POST /api/v3/orders/{orderNumber}/captures/{captureNumber}/shipping-details | Add new shipping details information to the capture. |
OrderManagementApi | orderManagementCapture | POST /api/v3/orders/{orderNumber}/captures | Completes the payment that has been authorized. Typically done when the order is shipped. Can be a full or partial capture of the order amount. |
OrderManagementApi | orderManagementDeleteShippingDetails | DELETE /api/v3/orders/{orderNumber}/captures/{captureNumber}/shipping-details/{shippingNumber} | Delete shipping details information from the specific capture. |
OrderManagementApi | orderManagementGetCapture | GET /api/v3/orders/{orderNumber}/captures/{captureNumber} | Returns all or specific captured payments of the order |
OrderManagementApi | orderManagementGetOrder | GET /api/v3/orders/{orderNumber} | Returns the contents of the specified order |
OrderManagementApi | orderManagementGetRefund | GET /api/v3/orders/{orderNumber}/refunds/{refundNumber} | Returns all or specific refunds of the order. |
OrderManagementApi | orderManagementGetShippingDetails | GET /api/v3/orders/{orderNumber}/captures/{captureNumber}/shipping-details/{shippingNumber} | Returns all or specific shipping details information of the capture. |
OrderManagementApi | orderManagementGetVoid | GET /api/v3/orders/{orderNumber}/voids/{voidNumber} | Returns all or specific voided (cancelled) authorizations of the order. |
OrderManagementApi | orderManagementRefund | POST /api/v3/orders/{orderNumber}/refunds | Refunds a partially or fully captured payment. |
OrderManagementApi | orderManagementUpdateShippingDetails | PATCH /api/v3/orders/{orderNumber}/captures/{captureNumber}/shipping-details/{shippingNumber} | Update shipping details information of the specific capture. |
OrderManagementApi | orderManagementVoid | POST /api/v3/orders/{orderNumber}/voids | Void (cancel) an authorization that has not been captured. |
ProductApi | productAvailableInstallmentPlans | POST /api/v3/lookup/installment-plans | Returns the available installment plans for the specific product/basket value. Returns monthly installment amount, interest and fees. Typically used on a product page. |
SearchApi | searchSearchInvoicesProcessed | POST /api/v3/search/invoices/processed | Returns invoices matching criteria |
Documentation For Models
- Account
- AccountProduct
- AddEventToAccountRequest
- AddEventToAccountResponse
- AddShippingDetailsRequest
- AddShippingDetailsResponse
- AddTransactionRequest
- AddTransactionResponse
- AdditionalData
- AdditionalTransactionInfo
- Address
- Airline
- ApplyForAccountCreditRequest
- ApplyForAccountCreditResponse
- AuthorizePaymentRequest
- AuthorizePaymentResponse
- AvailableInstallmentPlansRequest
- AvailableInstallmentPlansResponse
- AvailablePaymentMethodsRequest
- AvailablePaymentMethodsResponse
- Bus
- Campaign
- CampaignInfo
- CancellationItem
- Cancellations
- Capture
- CaptureItem
- CaptureRequest
- CaptureResponse
- CheckoutCustomer
- ConsolidatedInvoice
- Contract
- CreateContractRequest
- CreateContractResponse
- CreateUserRequest
- CreateUserResponse
- Customer
- CustomerLookupRequest
- CustomerLookupResponse
- CustomerResponse
- CustomerRisk
- DeleteShippingDetailsResponse
- DeleteTransactionResponse
- DirectDebit
- DirectDebitInfo
- EventItem
- Ferry
- GetAllCapturesResponse
- GetAllRefundsResponse
- GetAllShippingDetailsResponse
- GetOrderResponse
- GetRemainingLimitResponse
- GetStatusResponse
- GetVersionResponse
- GetVoidsResponse
- Hotel
- Installment
- InstallmentInfo
- Insurance
- Invoice
- Itinerary
- ListTransactionsResponse
- LookupAccountBySsnResponse
- LookupAddress
- MarkInvoicesProcessedRequest
- MarkInvoicesProcessedResponse
- Marketplace
- OkResult
- Order
- OrderItem
- OrderItemExtended
- OrderRisk
- OrderSummary
- ParkCustomer
- PartnerData
- Passenger
- Payment
- PaymentMethod
- References
- Refund
- RefundItem
- RefundOrderItem
- RefundOrderRequest
- RefundOrderResponse
- Rental
- ResponseMessage
- ResponseOrderDetails
- ShippingDetails
- ShippingDetailsWithNumber
- Subscription
- Train
- Transaction
- UpdateShippingDetailsRequest
- UpdateShippingDetailsResponse
- UserProfile
- ValidateAddressRequest
- ValidateAddressResponse
- ValidateBankAccountRequest
- ValidateBankAccountResponse
- VoidAuthorizationRequest
- VoidAuthorizationResponse
Documentation For Authorization
apiKey
- Type: API key
- API key parameter name: X-Auth-Key
- Location: HTTP header