Download the PHP package cmpayments/orderapi-sdk-php without Composer
On this page you can find all versions of the php package cmpayments/orderapi-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmpayments/orderapi-sdk-php
More information about cmpayments/orderapi-sdk-php
Files in cmpayments/orderapi-sdk-php
Package orderapi-sdk-php
Short Description CMPayments Order API SDK
License proprietary
Informations about the package orderapi-sdk-php
CMPayments Order API SDK for PHP
For more information about the Order API calls, see the documentation. This SDK is a toolbox, for more information about the inner workings of the Webdirect or One-Page-Checkout, see the integration manual at https://www.docdatapayments.com/developer/api/.
Installation
To install the SDK, simply use Composer:
Setting up a connection
Set up a connection by filling in the username
and password
. If you want to use the sandbox environment, add true
as third parameter.
All requests are created from this client.
Create request
This request will descripe a full request with a lot of optional fields.
First create a merchantOrderReference
which refers to the your internal unique reference for this order and is used by the system for informational purposes in the Merchant BackOffice.
The PaymentPreference specifies the settings to use for all payments which are going to be made on this order.
Replace <payment_profile>
with your own payment profile.
Different visual styles are supported through CSS profiles. The id of this profile can be set like this:
The payment system requires shopper information for each order. The name
element could also be provided with more information, like middlename
, suffix
, prefix
etc.
Set billing and shipping information for the transaction. The shipping and billing address are the same in this example, even the receivers name is the same.
Here an invoice is created with 3 products. 1 Kingston microSD card and 2 pieces of the DVD 'Lonely Planet Thailand'
The final step is to send the CreateRequest
to the API.
One Page Checkout
If you don't want to create different views for every payment method, there is a default checkout page that can be used. Note: The One Page Checkout is a feature that must be enabled in your account
startRequest
The start request is specific to the Webdirect scenario where a payment can be initiated without online interaction with the shopper. In this example we will start an iDEAL transaction. Note: The start request functionality is a feature that must be enabled in your account
List if iDEAL issuers in this API:
- ABNAMRO
- ASN
- BUNQ
- FRIESLANDBANK
- ING
- KNAB
- RABO
- REGIOBANK
- SNS
- TRIODOS
- VANLANSCHOT
proceedRequest
The proceed request is specific to the Webdirect scenario where the shopper is redirected to an acquirer. It is used to finish the authorisation after the merchant returns from the acquirer. For example when the shopper is sent directly to iDEAL or 3D Secure.
captureRequest
The purpose of the capture request is to force the payment system to capture a payment order which is successfully authorized for processing by the acquirer. This operation however is not required in all scenarios. Depending on the payment method, the payment system offers an option to automatically capture payment orders after a predefined number of days. This option supports payment methods like AfterPay and Klarna Invoice where products are only to be shipped when the products are collected for shipment
statusRequest
The status request can be used to retrieve a report reflecting the actual status of an Order, its payments and its captures or refunds. The statusRequest is used to determine whether an Order is considered “paid”.
statusExtendedRequest
The extended status request can be used to retrieve additional information of an Order, its payments and its captures or refunds.
cancelRequest
The purpose of the cancel request is to force the payment system not to accept any payment actions for the given Order anymore. In a scenario where a shopper has cancelled the order in the web shop, the cancel request is to be used to synchronize the administration in both the web shop and the payment system to ensure no payments are processed by the payment system for the order.
refundRequest
In cases where a merchant wants to refund a certain amount on a Payment Order the refund request can be used. The refund request enables the refund process to be controlled and automated end-to-end between the web shop and the payment system.
@Todo implement the full refund option instead of the simple version.