Lite SDK (Enrollment)

Overview

Similarly to what we have in the Full Payment Implementation, if you want to enroll/save the customer's payment method for a frictionless purchase experience using our payment_method_token, you have to follow the next steps:

Step 1: Create a customer

The first step of the payment flow is to create a customer. A customer will have payment methods associated, this is why it is important. You can create it using the Customer endpoint. As a result, you will receive the id of the customer that was created in the Yuno DB.

If you have created a customer that is going to pay previously you can skip this step.

Step 2: Create a customer session

To create enrollments, utilize the customer_session. Each enrollment requires a new Customer Session. By initializing a customer_session, you gain access to all available payment methods for enrollment, allowing you to extend these options to your customers.

Initiate a customer_session via this endpoint. For its creation, you'll need the customer ID, which was generated when you registered the customer in the Yuno system. This endpoint will then furnish you with a customer session ID, essential for enrolling payment methods.

After completing the above steps, proceed by implementing one of our SDKs to advance the enrollment process.

Step 3: Display payment methods

Query the available payment methods you have enabled via the Yuno integration by making a GET call to the Retrieve Payment Methods endpoint using the customer_session created in the previous step.

Display the available payment methods retrieved in the last step to the customer. Here the users will select the payment method they want to enroll within your platform and you should create a payment method by making an API request to the Enroll Payment Method endpoint, passing in the selected payment method and the customer_session.

By using SDK Lite, the merchant is responsible for displaying the payment methods and capturing the customer's selection.

Step 4: Implement Enrollment Lite SDK

In this step, you will have to initialize Yuno's Enrollment SDK with your API credentials and the checkout session previously created in step two. Below you will find a checklist to initialize the Yuno SDK:

Checklist

  1. Include the library in your project.
  2. Initialize SDK with the public key.
  3. Configure SDK by calling the function yuno.mountEnrollmentLite with the desired configuration.
  4. The configuration and mounting are done in the same step for the Enrollment Lite. To do it, use the yuno.mountEnrollmentLite

Step 5: Vaulted token

After the customer has completed the payment enrollment process, you can receive enrollment result with the vaulted_token via a webhook. This token can be saved and used for future payments.

On the other hand, if you want to render all the available payment methods regardless of the user, you can just follow the steps in the SDK Lite Payment Experience guideline.

For more detailed information on how to initiate Yuno's SDK please refer to one of the following sections according to the corresponding platform:

Web

iOS

Android