public final class EwayRapidAccessCodeApi
extends java.lang.Object
rapid.dbobj.EwayRapidAccessCode (persisted attempt row).| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
METHOD_CREATE_TOKEN
Rapid
Method to create a TokenCustomerID without charging. |
static java.lang.String |
METHOD_TOKEN_PAYMENT
Rapid
Method to charge (and create a token if the customer is new). |
static java.lang.String |
METHOD_UPDATE_TOKEN
Rapid
Method to replace the card on an existing TokenCustomerID. |
| Modifier and Type | Method and Description |
|---|---|
static EwayRapidAccessCodeResult |
create(EwayRapidClient client,
EwayRapidConnectionMethod connectionMethod,
JSONObject body)
POST
/AccessCodes or /AccessCodesShared and map the JSON. |
static EwayRapidAccessCodeResult |
fromCreateResponse(JSONObject response)
Map Rapid create-AccessCode JSON.
|
static EwayRapidAccessCodeResult |
fromQueryResponse(JSONObject response)
Map Rapid GET AccessCode JSON, including TransactionStatus.
|
static java.lang.String |
inferRapidMethod(java.lang.String tokenCustomerId,
int totalAmountCents)
Infer Rapid
Method: charge → TokenPayment; existing token, no
amount → UpdateTokenCustomer; otherwise CreateTokenCustomer. |
static EwayRapidAccessCodeResult |
query(EwayRapidClient client,
java.lang.String accessCode)
GET
/AccessCode/{AccessCode} and map the JSON. |
static JSONObject |
requestBody(java.lang.String rapidMethod,
java.lang.String tokenCustomerId,
java.lang.String title,
java.lang.String firstName,
java.lang.String lastName,
java.lang.String address,
java.lang.String suburbName,
java.lang.String state,
java.lang.String postcode,
java.lang.String country,
java.lang.String email,
java.lang.String phone,
java.lang.String mobile,
java.lang.String customerRef,
int totalAmountCents,
java.lang.String invoiceNumber,
java.lang.String invoiceDescription,
java.lang.String redirectUrl,
java.lang.String cancelUrl)
Build a create-AccessCode body.
|
public static final java.lang.String METHOD_CREATE_TOKEN
Method to create a TokenCustomerID without charging.public static final java.lang.String METHOD_UPDATE_TOKEN
Method to replace the card on an existing TokenCustomerID.public static final java.lang.String METHOD_TOKEN_PAYMENT
Method to charge (and create a token if the customer is new).@CheckReturnValue
@Nonnull
public static java.lang.String inferRapidMethod(java.lang.String tokenCustomerId,
int totalAmountCents)
Method: charge → TokenPayment; existing token, no
amount → UpdateTokenCustomer; otherwise CreateTokenCustomer.tokenCustomerId - stored Rapid token, or blanktotalAmountCents - Rapid Payment.TotalAmount in centsMethod constant@CheckReturnValue @Nonnull public static JSONObject requestBody(java.lang.String rapidMethod, java.lang.String tokenCustomerId, java.lang.String title, java.lang.String firstName, java.lang.String lastName, java.lang.String address, java.lang.String suburbName, java.lang.String state, java.lang.String postcode, java.lang.String country, java.lang.String email, java.lang.String phone, java.lang.String mobile, java.lang.String customerRef, int totalAmountCents, java.lang.String invoiceNumber, java.lang.String invoiceDescription, java.lang.String redirectUrl, java.lang.String cancelUrl)
rapidMethod - Rapid Method, or blank to infertokenCustomerId - existing TokenCustomerID for UpdateTokenCustomertitle - Rapid titlefirstName - Rapid FirstNamelastName - Rapid LastNameaddress - streetsuburbName - citystate - e.g. NSWpostcode - postcodecountry - ISO country (two-letter after mapping)email - emailphone - phonemobile - mobilecustomerRef - Rapid Customer.ReferencetotalAmountCents - Payment.TotalAmount (cents, negative clamped to 0)invoiceNumber - InvoiceNumber and InvoiceReferenceinvoiceDescription - invoice descriptionredirectUrl - Rapid RedirectUrl (mandatory)cancelUrl - Rapid CancelUrl (Shared Page / Iframe)java.lang.IllegalArgumentException - when redirectUrl is blank@CheckReturnValue @Nonnull public static EwayRapidAccessCodeResult create(EwayRapidClient client, EwayRapidConnectionMethod connectionMethod, JSONObject body) throws java.io.IOException
/AccessCodes or /AccessCodesShared and map the JSON.client - Rapid HTTP clientconnectionMethod - Transparent Redirect vs Shared Page / Iframebody - Rapid create body (no CardDetails)Errors looked up when present)java.io.IOException - Rapid transport or non-JSON HTTP error@CheckReturnValue @Nonnull public static EwayRapidAccessCodeResult query(EwayRapidClient client, java.lang.String accessCode) throws java.io.IOException
/AccessCode/{AccessCode} and map the JSON.client - Rapid HTTP clientaccessCode - Rapid AccessCodeErrors looked up when present)java.io.IOException - Rapid transport or non-JSON HTTP error@CheckReturnValue @Nonnull public static EwayRapidAccessCodeResult fromCreateResponse(JSONObject response)
response - Rapid JSON, or null@CheckReturnValue @Nonnull public static EwayRapidAccessCodeResult fromQueryResponse(JSONObject response)
response - Rapid JSON, or nullstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.