Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public static final class PlatformPay.Request

  1. Object
  2. PlatformPay.Request
A single payment: one total, in one currency.

Constructors

public Request(String label, String amount, String currencyCode, String countryCode)Creates a request.

Methods

public void setMerchantId(String merchantId)Sets the Apple Pay merchant id.
public void setMerchantName(String merchantName)Sets the merchant name Google Pay shows.
public void setGateway(String gateway, String gatewayMerchantId)Sets the PSP that will decrypt the Google Pay token.
public void setNetworks(String... networks)Sets the card networks to accept: VISA, MASTERCARD, AMEX, DISCOVER, JCB or INTERAC.
public void setTest(boolean test)Uses the wallet’s test environment (Google Pay only; Apple Pay uses a sandbox account instead).
public String toGoogleReadyJson()The Google Pay IsReadyToPayRequest this request maps to.
public String toGooglePayJson()The Google Pay PaymentDataRequest this request maps to.

Inherited methods

Constructor details

Request

public Request(String label, String amount, String currencyCode, String countryCode)
Creates a request.

Parameters

label String
the line the sheet shows next to the total
amount String
the total as a decimal string, such as "4.50"
currencyCode String
the ISO 4217 currency, such as "USD"
countryCode String
the ISO 3166 country of the merchant, such as "US"

Method details

setMerchantId

public void setMerchantId(String merchantId)
Sets the Apple Pay merchant id. It must be granted by the app.s com.apple.developer.in-app-payments entitlement.

Parameters

merchantId String
the merchant id, such as merchant.com.example

setMerchantName

public void setMerchantName(String merchantName)
Sets the merchant name Google Pay shows.

Parameters

merchantName String
the name

setGateway

public void setGateway(String gateway, String gatewayMerchantId)
Sets the PSP that will decrypt the Google Pay token.

Parameters

gateway String
the Google Pay gateway id, such as stripe
gatewayMerchantId String
the account id at that gateway

setNetworks

public void setNetworks(String... networks)
Sets the card networks to accept: VISA, MASTERCARD, AMEX, DISCOVER, JCB or INTERAC.

Parameters

networks String...
the networks

setTest

public void setTest(boolean test)
Uses the wallet’s test environment (Google Pay only; Apple Pay uses a sandbox account instead).

Parameters

test boolean
true for test payments

toGoogleReadyJson

public String toGoogleReadyJson()
The Google Pay IsReadyToPayRequest this request maps to.

Returns

the JSON text

toGooglePayJson

public String toGooglePayJson()
The Google Pay PaymentDataRequest this request maps to.

Returns

the JSON text