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

Merchant not enabled for Google Pay #111

Open
KthProg opened this issue Aug 19, 2018 · 10 comments

Comments

Projects
None yet
3 participants
@KthProg
Copy link

commented Aug 19, 2018

It's not clear how I would enable my account for Google Pay and following the docs exactly does not work. I am trying to use Stripe although I would be fine with using Google Pay directly.

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 19, 2018

In test mode it works fine, in that case I don't get a token back though.

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 20, 2018

It looks like the onActivityResult callback is not being called

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 20, 2018

It appeared to be fixed by adding this to my main activity class:

  public void onActivityResult(int requestCode, int resultCode, Intent data) {
    ((ReactInstanceManager)(Object)mReactInstanceManager.get()).onActivityResult(this, requestCode, resultCode, data );
  }
@KthProg

This comment has been minimized.

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 21, 2018

The original issue still remains. This only fixes the issue in the TEST environment.

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 27, 2018

@naoufal Any idea what's causing this?

@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 27, 2018

Here's my code (edited):

import React from 'react';
import { View } from 'react-native';
import { PaymentRequest } from 'react-native-payments';
import { logger } from 'react-native-logger';

export default class Market extends React.Component {
  static paymentMethodData = [{
    supportedMethods: ['android-pay'],
    data: {
      supportedNetworks: ['visa', 'mastercard', 'amex'],
      currencyCode: 'USD',
      //environment: 'TEST',
      paymentMethodTokenizationParameters: {
        tokenizationType: 'GATEWAY_TOKEN',
        parameters: {
          gateway: 'stripe',
          'stripe:publishableKey': Defaults.stripePubKeyLive,
          'stripe:version': '2018-07-27' // Only required on Android
        }
      }
    }
  }];

  constructor(props){
    super(props);
    // ...
  }

  purchaseCard(card){
    const paymentDetails = {
      displayItems: [
        {
          label: 'CardLife Market - ' + card.name,
          amount: { currency: 'USD', value: card.cost }
        }
      ],
      total: {
        label: '2e Soft',
        amount: { currency: 'USD', value: card.cost }
      }
    };
    const paymentRequest = new PaymentRequest(Market.paymentMethodData, paymentDetails);
    paymentRequest.show().then(paymentResponse => {
      const { getPaymentToken } = paymentResponse.details;
      return getPaymentToken()
        .then(paymentToken => {
          // server code here
        }).catch(failure => {
          paymentResponse.complete('failure');
        });
    }).catch(failure => {
      paymentRequest.abort();
    })
  }

  render() {
    return (
      <View>
          // ...
      </View>
    );
  }
}
@KthProg

This comment has been minimized.

Copy link
Author

commented Aug 27, 2018

It looks like you have to request production access for your merchant id. THis should be included in the documentation: (https://developers.google.com/pay/api/android/guides/test-and-deploy/integration-checklist)

@ChiragJadav-Bacancy

This comment has been minimized.

Copy link

commented Dec 31, 2018

I'm facing same issue and I am Implement this library https://github.com/JadavChirag/react-native-GPay. and Its working fine for me. It build production and development fine as well as :)

@mihir-bacancy

This comment has been minimized.

Copy link

commented Dec 31, 2018

I'm facing same issue and I am Implement this library https://github.com/JadavChirag/react-native-GPay. and Its working fine for me. It build production and development fine as well as :)

Thanks Its also work for me. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.