https://github.com/mukezhz/aws-services-go
Amazon Pay SDK for golang
https://github.com/mukezhz/aws-services-go
amazon-pay amazon-pay-go amazon-pay-sdk aws aws-pay-go aws-services
Last synced: 3 months ago
JSON representation
Amazon Pay SDK for golang
- Host: GitHub
- URL: https://github.com/mukezhz/aws-services-go
- Owner: mukezhz
- Created: 2024-02-01T11:28:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-11T02:52:13.000Z (over 1 year ago)
- Last Synced: 2025-01-15T12:22:19.144Z (5 months ago)
- Topics: amazon-pay, amazon-pay-go, amazon-pay-sdk, aws, aws-pay-go, aws-services
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Amazon Pay SDK for golang
- Golang SDK for Amazon pay
- Original Author: [here](https://github.com/gotokatsuya/amazon-pay-sdk-go)
## Changes:
- Client constructor takes the struct for input
- Since amazon has changed the generation of signature in v2 it's compatible here
## Why new SDK?
- Since the repository of original author hasn't been changed since 3 years so I decided to create one### Flow of the amazon pay:
- Client inject the js script provided by the amazon
- Client will generate a signature by providing the the payload to your server
- Client gets the amazon button on clicking the button client redirects to the amazon site after adding card and shipping detail
- on successful:
- It will be redirected to the CheckoutReviewReturnURL
- on cancel:
- It will be redirected to the same page
- Client will use the session ID generated by the amazon `sessionID will be appended in the CheckoutReviewReturnURL` to get the detail about the session
- If there is missing value for successful payment you will get in the `constraints` property of the result of session detail
- In case there is missing client needs to update the fields
- Client will get the amazon checkout url in:
- `WebCheckoutDetails` -> `AmazonPayRedirectURL`
- Navigate to the `AmazonPayRedirectURL` and complete the process
- ON PAYMENT SUCCESS: redirect to `CheckoutResultReturnURL`
- ON PAYMENT CANCEL: redirect to `CheckoutCancelUrl`### USE SDK:
- Create a client of `amazonpay`
- Sign the payload using `GenerateButtonSignature` method
- Get the session detail using `GetCheckoutSession` method
- Update the payload using `UpdateCheckoutSession` method
- Complete the checkout using `CompleteCheckoutSession` method