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

In test what is @merchant_id to be filled with? #14

Open
mattpoq-belk opened this issue May 18, 2018 · 2 comments
Open

In test what is @merchant_id to be filled with? #14

mattpoq-belk opened this issue May 18, 2018 · 2 comments

Comments

@mattpoq-belk
Copy link

mattpoq-belk commented May 18, 2018

I'm attempting to use rake test with my certificate and paymentData. But I'm unsure what should go in @merchant_id in setup.

Same for @shared_secret and @symmetric_key, where do I get these from?

@ct-clearhaus
Copy link

The symmetric key is generated from the merchant id and the shared secret: https://github.com/spreedly/gala/blob/master/lib/gala/payment_token.rb#L98-L110

The merchant id can be extracted from the merchant's certificate: https://github.com/spreedly/gala/blob/master/lib/gala/payment_token.rb#L81-L88
(See "Party V Info" on https://developer.apple.com/library/content/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html.)

The shared secret is generated from the merchant's private key and the payment token's ephemeral public key: https://github.com/spreedly/gala/blob/master/lib/gala/payment_token.rb#L90-L94

Shameless plug: If you are testing out stuff in non-production, you could perhaps benefit from https://github.com/clearhaus/pedicel-pay 🙂

@inturbidus
Copy link

Very nice! I should've been more clear about what I was asking. I was asking is it meant to be a simple string of the shared secret and symmetric key, because the output is not a standard string. So I didn't know how to convert the output into something that could be put into those variables.

Awesome repo for working locally! Wish I had seen that before.

Shameless plug of my own. I was attempting to do this as NPM since there are few NPM examples. With the help of @murcialito I was able to make a working example in JS. https://github.com/inturbidus/applepay-token

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

No branches or pull requests

3 participants