square / square-dotnet-sdk

.NET client library for the Square API
https://developer.squareup.com
Other
55 stars 30 forks source link

Finalizing Google Pay payments with the dotnet SDK #25

Closed aadupirn closed 4 years ago

aadupirn commented 4 years ago

Google lists Square as a payment gateway in their Google Pay documentation for Google Actions.

Once I have the PaymentData payload I'm having a hard time figuring out which API to use to complete the transaction with square. Is this something that is coming to the SDK in the future or should I be using the payments or checkout API functionality that already exists?

Thanks

StephenJosey commented 4 years ago

Most of the setup is on Square's side (https://developer.squareup.com/docs/payment-form/add-digital-wallets/google-pay), however there is a step that you need to submit to Google to get access to production mode (see link provided). It's not directly in the .NET SDK because you need to use the Square Payment Form to actually take payments (which is not in any SDK; it's a front-end Javascript library), unless you're using the Checkout API, in which case GooglePay should automatically be enabled since it's hosted by Square, I believe. Let me know if you have questions about this, though!

aadupirn commented 4 years ago

Gotcha, I'm working on Google actions that integrate with Google Pay so there's no front-end development work. The integration between the Google Action does 90% of the back and forth and then provides a PaymentData payload when the user of the action approves a purchase. I believe I have to create a checkout using the Payment Data though I'm not sure how to correctly pass the data to Square in the final step or how to build a checkout api request with the data. This is all after creation of the order with address and line item information.

For a more concrete example of what I'm trying to do I've done the same thing with Authorize.Net by base64 encoding the PaymentData token from google and passing it to a createTransactionRequest as specified at the end of the page here: https://developer.authorize.net/api/reference/features/in-app.html .

All the AoG documentation is here: https://developers.google.com/assistant/transactions/physical/dev-guide-physical-gpay#df_check_requirements_json

StephenJosey commented 4 years ago

Thanks for clarifying! Do you mind reaching out to our API Support team (https://squareup.com/help/contact?panel=BF53A9C8EF68)? I think they'll be able to help you out a bit better than I can. Please reference this issue directly for reference. Thank you!

aadupirn commented 4 years ago

Sure thing. I'll update this issue with any resolution I receive from them. Thanks!

sseaman commented 4 years ago

Hey @aadupirn, any update? If not, would it be OK to close?