Class PlatformPay.Request

java.lang.Object
com.codename1.payment.PlatformPay.Request
Enclosing class:
PlatformPay

public static final class PlatformPay.Request extends Object
A single payment: one total, in one currency.
  • Constructor Details

    • Request

      public Request(String label, String amount, String currencyCode, String countryCode)

      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

      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: the merchant id, such as merchant.com.example
    • setMerchantName

      public void setMerchantName(String merchantName)

      Sets the merchant name Google Pay shows.

      Parameters
      • merchantName: the name
    • setGateway

      public void setGateway(String gateway, String gatewayMerchantId)

      Sets the PSP that will decrypt the Google Pay token.

      Parameters
      • gateway: the Google Pay gateway id, such as stripe

      • gatewayMerchantId: 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: 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

      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