Class PlatformPay.Request
java.lang.Object
com.codename1.payment.PlatformPay.Request
- Enclosing class:
PlatformPay
A single payment: one total, in one currency.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetGateway(String gateway, String gatewayMerchantId) Sets the PSP that will decrypt the Google Pay token.voidsetMerchantId(String merchantId) Sets the Apple Pay merchant id.voidsetMerchantName(String merchantName) Sets the merchant name Google Pay shows.voidsetNetworks(String... networks) Sets the card networks to accept:VISA,MASTERCARD,AMEX,DISCOVER,JCBorINTERAC.voidsetTest(boolean test) Uses the wallet's test environment (Google Pay only; Apple Pay uses a sandbox account instead).The Google PayPaymentDataRequestthis request maps to.The Google PayIsReadyToPayRequestthis request maps to.
-
Constructor Details
-
Request
Creates a request.
Parameters
-
label: the line the sheet shows next to the total -
amount: the total as a decimal string, such as"4.50" -
currencyCode: the ISO 4217 currency, such as"USD" -
countryCode: the ISO 3166 country of the merchant, such as"US"
-
-
-
Method Details
-
setMerchantId
Sets the Apple Pay merchant id. It must be granted by the app.s
com.apple.developer.in-app-paymentsentitlement.Parameters
merchantId: the merchant id, such asmerchant.com.example
-
setMerchantName
Sets the merchant name Google Pay shows.
Parameters
merchantName: the name
-
setGateway
-
setNetworks
Sets the card networks to accept:
VISA,MASTERCARD,AMEX,DISCOVER,JCBorINTERAC.Parameters
networks: 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: true for test payments
-
toGoogleReadyJson
The Google Pay
IsReadyToPayRequestthis request maps to.Returns
the JSON text
-
toGooglePayJson
The Google Pay
PaymentDataRequestthis request maps to.Returns
the JSON text
-