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
- Object
- 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
labelString- the line the sheet shows next to the total
amountString- the total as a decimal string, such as
"4.50" currencyCodeString- the ISO 4217 currency, such as
"USD" countryCodeString- 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
merchantIdString- the merchant id, such as
merchant.com.example
setMerchantName
public void setMerchantName(String merchantName)Sets the merchant name Google Pay shows.
Parameters
merchantNameString- the name
setGateway
public void setGateway(String gateway, String gatewayMerchantId)Sets the PSP that will decrypt the Google Pay token.
Parameters
gatewayString- the Google Pay gateway id, such as
stripe gatewayMerchantIdString- 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
networksString...- 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
testboolean- 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