Payment-method icon

Zip Redirect Component

Add Zip to your existing iOS Components integration.

This page explains how to add Zip to your existing iOS Components integration.

Requirements

Requirement Description
Integration type Make sure that you have built your iOS Components integration.
Setup steps Before you begin, add Zip in your test Customer Area.

API reference

Select which endpoint you are using:

This is the default with Components v5.0.0 or later.

Parameter name Required Description
shopperName Shopper's first name and last name.
shopperEmail The shopper's email address.
dateOfBirth The shopper's date of birth.
telephoneNumber The shopper's phone number.
billingAddress The address where to send the invoice.
deliveryAddress -white_check_mark- The address where the purchased goods should be delivered.
lineItems -white_check_mark- Price and product information about the purchased items.

You can optionally specify an imageURL to have the picture of the item on the Zip product page. The shopper will see this image when they log into their Zip account. The URL must have a maximum of 500 characters.
Expand view
Copy link to code block
Copy code
Copy code
curl https://checkout-test.adyen.com/v69/sessions \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"reference": "YOUR_ORDER_REFERENCE",
"amount": {
"currency": "AUD",
"value": 1000
},
"telephoneNumber": "+61121212121",
"shopperEmail": "shopper@email.com",
"shopperName": {
"firstName": "Simon",
"lastName": "Hopper"
},
"billingAddress":{
"city":"Sydney",
"country":"AU",
"houseNumberOrName":"123",
"postalCode":"2000",
"stateOrProvince":"NSW",
"street":"Happy Street"
},
"deliveryAddress":{
"city":"Sydney",
"country":"AU",
"houseNumberOrName":"123",
"postalCode":"2000",
"stateOrProvince":"NSW",
"street":"Happy Street"
},
"lineItems":[
{
"description":"Shoes",
"quantity":"1",
"amountIncludingTax":"400",
"id":"Item #1"
},
{
"description":"Socks",
"quantity":"2",
"amountIncludingTax":"300",
"id":"Item #2"
}
],
"dateOfBirth": "1996-09-04",
"returnUrl": ""
}'

Component configuration

v5.0.0 or later

If your integration uses iOS Components v5.0.0 or later, configure and create an instance of the Zip Component:

Component configuration
Expand view
Copy link to code block
Copy code
Copy code
let paymentMethods = session.sessionContext.paymentMethods
// Check that the payment method is supported before showing the Component.
guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("zip")) else { return }
let component = InstantPaymentComponent(paymentMethod: paymentMethod,
context: context,
order: nil)
self.currentComponent = component
// Set the session as the delegate.
component.delegate = session
component.initiatePayment()

v4.x.x

If your integration uses an earlier version of iOS Components:

Component configuration
Expand view
Copy link to code block
Copy code
Copy code
// Check that the payment method is supported before showing the Component.
guard let paymentMethod = paymentMethods.paymentMethod(ofType: PaymentMethod.self) else { return }
let style = FormComponentStyle()
let component = Component(paymentMethod: paymentMethod,
apiContext: context,
style: style)
present(component)

There are no configuration steps specific to Zip required for Components.

Recurring payments

We support recurring transactions for Zip. To make recurring payments, you need to:

  1. Create a shopper token.
  2. Use the token to make future payments for the shopper.

Create a token

To create a token, include in your /payments request:

  • storePaymentMethod: true
  • shopperReference: Your unique identifier for the shopper.

When the payment has been settled, you receive a webhook containing:

  • eventCode: RECURRING_CONTRACT
  • originalReference: The pspReference of the initial payment.
  • pspReference: This is the token that you need to make recurring payments for this shopper.

Make sure that your server is able to receive RECURRING_CONTRACT as part of your standard webhooks. You can enable the RECURRING_CONTRACT event code in the webhook settings page.

Make a payment with a token

To make a payment with the token, include in your /payments request:

  • paymentMethod.storedPaymentMethodId: The pspReference from the RECURRING_CONTRACT.

    You can also get this value using the /listRecurringDetails endpoint.

  • shopperReference: The unique shopper identifier that you specified when creating the token.

  • shopperInteractionContAuth.

  • recurringProcessingModel: Subscription or UnscheduledCardOnFile.

For more information about the shopperInteraction and recurringProcessingModel fields, refer to Tokenization.

Expand view
Copy link to code block
Copy code
Copy code
curl https://checkout-test.adyen.com/v68/payments \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
"amount":{
"value":1000,
"currency":"AUD"
},
"paymentMethod":{
"type":"zip",
"storedPaymentMethodId":"7219687191761347"
},
"reference":"YOUR_ORDER_NUMBER",
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"shopperReference":"YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
"shopperInteraction":"ContAuth",
"recurringProcessingModel": "Subscription"
}'

Test and go live

Create Zip test accounts using the credentials on Zip's test credentials page. You can then use your test account to make a payment in the test environment.

Check the status of Zip test payments in your Customer Area > Transactions > Payments.

Before you can accept live Zip payments, you need to submit a request for Zip in your live Customer Area.

See also