This sample code demonstrate how you can process a direct credit card payment. Please note that direct credit card payment and related features using the REST API is restricted in some countries. API used: /v1/payments/payment
[Optional] Billing address associated with card.
A resource representing a credit card that can be used to fund a payment.
A resource representing a Payer's funding instrument. For direct credit card payments, set the CreditCard field on this object.
A resource representing a Payer that funds a payment For direct credit card payments, set payment method to 'credit_card' and add an array of funding instruments.
Lets you specify a payment amount. You can also specify additional details such as shipping, tax.
A transaction defines the contract of a payment - what is the payment for and who is fulfilling it.
A Payment Resource; create one using the above types and intent set to sale 'sale'
Create a payment by posting to the APIService
using a valid ApiContext (See bootstrap.php for more on ApiContext)
The return object contains the state.
CreatePaymentSample