Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android implementation updates #396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

litinskii
Copy link

This is the work of #174 with updated readme.

For most question changes are described at #174.

just added some notes to readme
main question about allowedPaymentMethods and how to generate publicKey in section below

const METHOD_DATA = [{
  supportedMethods: ['android-pay'],
  data: {
    supportedNetworks: ['visa', 'mastercard', 'amex'],
    // https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants.html 
    // PAYMENT_METHOD_CARD and PAYMENT_METHOD_TOKENIZED_CARD.. or [1, 2]
    allowedPaymentMethods: [1, 2], 
    currencyCode: 'USD',
    environment: 'TEST', // defaults to production
    paymentMethodTokenizationParameters: {
      tokenizationType: 'NETWORK_TOKEN', // or GATEWAY_TOKEN
      parameters: {
        publicKey: 'your-pubic-key' // https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl
        //  if use GATEWAY_TOKEN
        //  gateway: 'your gateway',
        //  gatewayMerchantId: 'your gatewayMerchantId',
        //  merchantName: 'your merchantName',
      }
    }
  }
}];

@litinskii
Copy link
Author

Update tokenization

const METHOD_DATA = [{
  supportedMethods: ['android-pay'],
  data: {
    supportedNetworks: ['visa', 'mastercard', 'amex'],
    // https://developers.google.com/android/reference/com/google/android/gms/wallet/WalletConstants.html 
    // PAYMENT_METHOD_CARD and PAYMENT_METHOD_TOKENIZED_CARD.. or [1, 2]
    allowedPaymentMethods: [1, 2], 
    currencyCode: 'USD',
    environment: 'TEST', // defaults to production
    paymentMethodTokenizationParameters: {
      tokenizationType: 'PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT', // or PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY 
      parameters: {
        publicKey: 'your-pubic-key' // https://developers.google.com/pay/api/android/guides/resources/payment-data-cryptography#using-openssl
        //  if use PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY
        //  gateway: 'your gateway',
        //  gatewayMerchantId: 'your gatewayMerchantId',
        //  merchantName: 'your merchantName',
      }
    }
  }
}];

@litinskii
Copy link
Author

Add intermediateSigningKey for G pay integration.

intermediateSigningKey: {
    signatures: [array],
    signedKey: string
}

@litinskii litinskii changed the title Reference to https://github.com/naoufal/react-native-payments/pull/174 with updated readme Android implementation updates May 19, 2023
@litinskii litinskii closed this Jun 6, 2023
* update build.gradle

- Use implementation over deprecated compile
- Update compile and target sdk to 28
- Add additional dependency for Google Pay

* Automatically update AndroidManifest adding required meta-data

* Update android implementation to Google Pay

- Use non-deprecated classes
- Remove not needed and not used FullWallet stuff
- Receive allowed card networks from client
- Receive allowed payment methods from client

* use AndroidX appcompat library, remove useless library

* return card info from GPay to clients

* don't validate gateways on Android

* update package version

* refactor NativePayments.canMakePayments

- Remove it from PaymentRequest
- Change input to require only required data

* bump version

* refactor NativePayments.canMakePayments

- Remove it from PaymentRequest
- Change input to require only required data

* add environment to CanMakePayments type

* fix podspec

There are .h/.m files in subdirectories that weren't currently being
considered when the package is installed as a pod. This fixes it by
making them accessible.

* add ignore

* update readmi

* update readmi

* Fix import

* Some fixes

* update readmi

* Some fixes

* Update version

* update

* Fix depricatios

* update

* Fix depricatios

* add intermediateSigningKey

* add intermediateSigningKey

* update

* add intermediateSigningKey

* use array for signatures

* use array for signatures

* use array for signatures

* use array for signatures

* use array for signatures

* use array for signatures

* use array for signatures

* use array for signatures

* update lib / remove not used

* update lib / remove not used

* 0.7.1

* 0.8.3-1

---------

Co-authored-by: Valerio Ponte <valerio.ponte@gmail.com>
@litinskii litinskii reopened this Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant