Virtual Card Checkout
Virtual Card Checkout
Overview
Items you will need:
- The Zip Android SDK
- The Start Checkout call in your Android app
- An order confirmation endpoint on your server
Implementation
The Zip Android SDK
- Our SDK is currently only available privately, please inquire with your Zip Account Manager.
How to start a Zip checkout
Add Zip
Add:
mavenCentral()
to your repositories then add:
implementation 'com.quadpay:quadpay:0.3.7@aar'
to build.gradle
Consult your Account manager about the version you should include!
Initialize the Zip SDK
Your Merchant ID will be provided by your Zip Integrations Engineer.
QuadPay.initialize(new QuadPay.Configuration.Builder("<your-merchant_id>")
.setEnvironment(QuadPay.Environment.SANDBOX)
.setLocale(QuadPay.Locale.US)
.build()
);
Begin the Zip checkout flow
Once presented the customer will be shown the Zip checkout flow.
final QuadPayCheckoutDetails details = new QuadPayCheckoutDetails();
details.amount = "100";
details.customerFirstName = "Zip";
details.customerLastName = "Customer";
details.customerEmail = "[email protected]";
details.customerPhoneNumber = "+15555555555";
details.customerAddressLine1 = "123 Main St";
details.customerAddressLine2 = "10th Floor";
details.customerPostalCode = "10003";
details.customerCity = "New York";
details.customerState = "NY";
details.customerCountry = "US";
details.merchantFeeForPaymentPlan: "0";
details.merchantReference = "<your-unique-order-id>";
QuadPay.startVirtualCheckout(<your activity instance>, details);
Implement the checkout delegate functions:
These functions give your application information regarding the result of the Zip checkout flow.
Register for activity results
@Override
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (QuadPay.handleQuadPayActivityResults(
this,
requestCode,
resultCode,
data
)) {
return;
}
super.onActivityResult(requestCode, resultCode, data);
}
Checkout Success
This function returns a token you may exchange to confirm an order has been created.
@Override
public void checkoutSuccessful(QuadPayCard card, QuadPayCardholder cardholder, String orderId) {
// Submit the card and cardholder details through your standard payment processor!
}
Checkout Cancelled
This function is called when the user cancels the Zip process or is declined.
@Override
public void checkoutCancelled(String reason) {
// A reason describing why checkout was cancelled is returned
}
Finishing the Zip order
Once you have received a virtual card number in a success delegate you may authorize and capture it up to the value provided at the beginning of checkout. The card that is issued is a standard Visa card and all authorize/capture/refund functionality will work as expected.
More information and frequently asked questions are available at https://developers.zip.co/v9-US/docs/how-it-works.
Updated about 2 years ago