This page explains how to add Paytm 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 Paytm in your test Customer Area. |
API reference
You do not need to send additional fields for Paytm. To see optional fields that you can send for all payment methods, choose the endpoint you integrated:
- /sessions: This is the default with Components v5.0.0 or later.
- /payments: If you implemented an additional use case.
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 Paytm Component:
let paymentMethods = session.sessionContext.paymentMethods // Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: .other("paytm")) 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:
// Check that the payment method is supported before showing the Component. guard let paymentMethod = paymentMethods.paymentMethod(ofType: PaytmPaymentMethod.self) else { return } let style = FormComponentStyle() let component = PaytmComponent(paymentMethod: paymentMethod, apiContext: context, style: style) present(component)
There are no configuration steps specific to Paytm required for Components.
Test and go live
Before you go live, test your integration using the following credentials:
Mobile number | OTP | Password |
---|---|---|
7777777777 | 489871 | Paytm12345 |
Check the status of Paytm test payments in your Customer Area > Transactions > Payments.
Before you can accept live Paytm payments, you need to submit a request for Paytm in your live Customer Area.