Initiating a Payment for Mobile Android Payments

For this payment request, the user enters card data directly on the mobile device. Use this payment request type when the following holds:

  • Paysafe does not support Android Pay in the country in which you are operating; and
  • Your consumer does not have any cards on file with Google.

The method below will call the single-use token service within the Customer Vault API, using credit card and billing address details. This API will return a single-use token. Single-use tokens are valid for only 15 minutes and are not consumed by verification.

The request to the Customer Vault API requires the use of the API key for single-use tokens.

Once a single-use token is received from the Customer Vault API, it must be sent to the merchant's server. The merchant must then include it in the payment request that is sent to the Card Payments API (using the API key for server-to-server API calls).

import com.paysafe.PaysafeApiClient;
import com.paysafe.Environment;
import com.paysafe.customervault.SingleUseToken;

PaysafeApiClient client = new PaysafeApiClient(apiKey, apiPassword, Environment.TEST, accountNumber);

try {
      SingleUseToken sObjResponse = client.customerVaultService().createSingleUseToken(
                   .holderName("Mr. John Smith")
                     .street("100 Queen Street West")
                     .street2("Unit 201")
                     .zip("M5H 2N2")

      return sObjResponse;

} catch (IOException e) {
} catch (PaysafeException e) {
} catch (Exception e) {
Did you find this page useful?