First integration

This guide will help you to make your first payment with ready-to-use payment forms.

Demo app

You are welcome to get started with our demo application. You can start making test transactions without any efforts including setting up a server, we provide a test integration server for you. Please note, that it is configured for demo purposes only.

The demo app is provided along with SDK since version 2.5.0.

NOTE: Before running the application, make sure SDK files are copied to the demo app folder. Find more details in the readme.txt file.

Todo

Requirements

Install the SDK

#import <OPPWAMobile/OPPWAMobile.h>

NOTE: If you integrate SDK to the Swift app, please see the Apple guide Importing Objective-C into Swift to check how to import Objective-C headers correctly.

Set Up Your Server

To start working with our SDK, you should expose two APIs on your backend for your iOS app to communicate with:

  • Endpoint 1: Creating a checkout ID,
  • Endpoint 2: Getting result of payment.

See detailed instruction in our guide Set Up Your Server.

Request Checkout ID

Your app should request a checkout ID from your server. This example uses our sample integration server; please adapt it to use your own backend API.

Present Checkout UI

2. Configure the Checkout Settings

Define the settings for the checkout screen. Initialize OPPCheckoutSettings, it controls the information that is shown to the shopper.
For the first integration we recommend you to enable only synchronous payment methods, other payment brands need additional configuration.

NOTE: To learn more about shopper result url refer to Asynchronous Payments guide.

3. Present the Checkout Page

Initialize OPPCheckoutProvider with the received checkout ID and created settings.

Then, open the payment page and implement the callbacks.

For versions 2.12.0 and earlier use another method to open the checkout page.
Note there is an additional callback paymentBrandSelectedHandler which allows you to create and pass to the SDK new checkout ID. In newer versions this callback is moved to OPPCheckoutProviderDelegate. You may need this feature to send additional parameters at 1st step for specific payment brands. Otherwise set callback to nil.

[Optional] 4. Security Disable third party keyboards.

A malicious third party keyboard may perform key-logging and transmit the logged information to an attacker’s server. It’s recommended to disable the usage of third party keyboards entirely in your application. Note that this may degrade the user experience of your application.

Request Payment Status

Finally your app should request the payment status from your server (again, adapt this example to your own setup).

NOTE: The transaction status may be not available immediately. To support all statuses please refer to the Result Codes.

Testing

The sandbox environment only accepts test payment parameters.

You can find test values for credit cards and bank accounts in our Testing Guide.

Go to Production

  1. Talk to your account manager to get the live credentials.
  2. Adjust the server type to LIVE in your initialization of OPPPaymentProvider.

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

******Note: Start of Andriod page a button with the ability to toggle between iOs and Android will be inserted at an later time******

Requirements

Install the SDK

implementation fileTree(dir: "libs", include: ["*.aar"])
2. Add the required dependencies to your build.gradle:
implementation "androidx.appcompat:appcompat:x.x.x"
implementation "androidx.browser:browser:x.x.x"
implementation "com.google.android.material:material:x.x.x"
implementation "com.google.android.gms:play-services-base.x.x"

If you want to use prebuilt checkout also declare the CheckoutActivity:

<activity
    tools:replace="android:theme"
    android:name="com.oppwa.mobile.connect.checkout.dialog.CheckoutActivity"
    android:theme="@style/Theme.Checkout.Light"
    android:windowSoftInputMode="adjustPan"
    android:exported="false"
    android:launchMode="singleTop"/>

NOTE: Don’t set screenOrientation attribute for the CheckoutActivity if your targetSdkVersion is 27 or higher.

NOTE: Make sure you set the tools:replace="android:theme" attribute for the CheckoutActivity. It belongs to the Android tools namespace, so you must first declare this namespace in the element: xmlns:tools="http://schemas.android.com/tools". Also if you use your custom style it must extend the Theme.Checkout style.

3. In addition, declare the “INTERNET” permission before the application tag:

<uses-permission android:name="android.permission.INTERNET"/>

Set Up Your Server

To start working with our SDK, you should expose two APIs on your backend for your iOS app to communicate with:

  • Endpoint 1: Creating a checkout ID,
  • Endpoint 2: Getting result of payment.

See detailed instruction in our guide Set Up Your Server.

Request Checkout ID

Your app should request a checkout ID from your server. This example uses our sample integration server; please adapt it to use your own backend API.

Present Checkout UI

NOTE: To learn more about shopper result url refer to Asynchronous Payments guide.

2. Present the Checkout Page Set up the Intent and start the checkout activity:
Finally, override onActivityResult to get notified when the checkout process is done.

NOTE: The getErrorInfo() method of the PaymentError can be used to get more details about the error.

Request Payment Status

Finally your app should request the payment status from your server (again, adapt this example to your own setup).

NOTE: The transaction status may be not available immediately. To support all statuses please refer to the Result Codes.

Testing

The sandbox environment only accepts test payment parameters.

You can find test values for credit cards and bank accounts in our Testing Guide.

 

Go to Production

  1. Talk to your account manager to get the live credentials.
  2. Adjust the server type to LIVE in your initialization of CheckoutSettings.

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