author lvairamani
Load SDK configuration for the resource. This intialization code can be done as Init Servlet.
Sample showing to create a Payment using CreditCard as a FundingInstrument
Base Address object used as shipping or billing address in a payment. [Optional]
A resource representing a credit card that can be used to fund a payment.
Let's you specify details of a payment amount.
Let's you specify a payment amount.
Total must be equal to sum of shipping, tax and subtotal.
A transaction defines the contract of a
payment - what is the payment for and who
is fulfilling it. Transaction is created with
a Payee
and Amount
types
The Payment creation API requires a list of
Transaction; add the created Transaction
to a List
A resource representing a Payeer's funding instrument.
Use a Payer ID (A unique identifier of the payer generated
and provided by the facilitator. This is required when
creating or using a tokenized funding instrument)
and the CreditCardDetails
The Payment creation API requires a list of
FundingInstrument; add the created FundingInstrument
to a List
A resource representing a Payer that funds a payment
Use the List of FundingInstrument
and the Payment Method
as 'credit_card'
A Payment Resource; create one using the above types and intent as 'sale'
Retrieve the access token from OAuthTokenCredential by passing in ClientID and ClientSecret It is not mandatory to generate Access Token on a per call basis. Typically the access token can be generated once and reused within the expiry window
Pass in a ApiContext
object to authenticate
the call and to send a unique request id
(that ensures idempotency). The SDK generates
a request id if you do not pass one explicitly.
Use this variant if you want to pass in a request id that is meaningful in your application, ideally a order id. String requestId = Long.toString(System.nanoTime(); APIContext apiContext = new APIContext(accessToken, requestId ));
Create a payment by posting to the APIService using a valid AccessToken The return object contains the status;
CreatePayment using credit card Sample
This sample code demonstrate how you can process a payment with a credit card. API used: /v1/payments/payment