Payment Drop-In Buttons

Drop-in buttons extend standard buttons in order to easily integrate separate payment brands to your app.
This article is intended to guide you through the process of creating and configuring drop-in buttons.

Create payment button

The easiest way to create payment button is to add it in Interface Builder. Payment button needs only payment brand to be set to automatically display appropriate logo. You can set your own logo for the button and do all necessary customizations as well.

Drag-n-drop standard button to the view and set class OPPPaymentButton on Identity Inspector tab.

NOTE: for some payment brands no additional user info in app is required, shopper will be directly redirected to the issuer web page (e.g. PayPal). In this case you don't need to create checkout settings.

Tokenization

mSDK checkout page can display stored token for selected payment brand. You need to add additional parameter to the normal prepare checkout request (step 1). Your server should send shopper's tokens along with other configuration data such as amount, currency, order type and etc.

Request Payment Status

Finally your app should request the payment status from your server (again, adapt this example to your own setup). Based on chosen approach you will have to send checkout Id or resource path to your server.

2. Adjust the server type to LIVE in your initialization of OPPPaymentProvider.

3. Change your backend to use the correct API endpoints and credentials.

Create payment button

The easiest way to create payment button is to add it in your layout's xml. Payment button needs only payment brand to be set to automatically display appropriate logo. You can set your own logo for the button and do all necessary customizations as well.

Add PaymentButtonFragment to your activity. You can do it in two ways:

Tokenization

The mSDK checkout page can display stored token for selected payment brand. Add the additional parameter to the normal prepare checkout request. Your server should send shoppers' tokens along with other configuration data such as amount, currency, order type and etc.

NOTE: It is important to set android:exported="false" to your broadcast receiver. In this case the only messages the broadcast receiver can receive are those sent by components of the same application or applications with the same user ID.

To provide the best security our SDK uses directed broadcasts. This way our broadcast is received only by the specified BroadcastReceiver. For this reason you should pass ComponentName of your receiver to the submitTransaction function.

[Only for versions from 2.26.0 upto 2.32.0] Your activity that contains payment button fragment will receive new intent from the CheckoutBroadcastReceiver for the brands that do not need UI. In this case you should pass this intent to the payment button fragment in the onNewIntent method of your activity: