amazon-pay-sdk-go

Amazon Pay Go SDK

Github星跟踪图

Amazon Pay Go SDK

Amazon Pay SDK for Golang

Install

go get github.com/qor/amazon-pay-sdk-go

Usage

import amazonpay "github.com/qor/amazon-pay-sdk-go"

func main() {
  var client = amazonpay.New(&amazonpay.Config{
    MerchantID: "my merchant id",
    AccessKey:  "my access key",
    SecretKey:  "my secret key",
    Sandbox:    true,
    Region:     "jp",
  })

  // Set order details such as order amount and explanation in Order Reference
  client.SetOrderReferenceDetails(orderReferenceID, amazonpay.OrderReferenceAttributes) (amazonpay.SetOrderReferenceDetailsResult, error)

  // confirm order details
  client.ConfirmOrderReference(orderReferenceID) error

  // Returns the details and current state of the Order Reference object
  client.GetOrderReferenceDetails(orderReferenceID, addressToken) (amazonpay.GetOrderReferenceDetailsResponse, error)

  // Process secures the funds specified for the payment method stored in the Order Reference
  client.Authorize(orderReferenceID, authorizationReferenceID, amount, amazonpay.AuthorizeInput) (amazonpay.AuthorizeResponse, error)

  // Returns the total authorized amount for authorization status and authorization
  client.GetAuthorizationDetails(authorizationID) (amazonpay.GetAuthorizationDetailsResponse, error)

  // CloseAuthorization Close authorization
  client.CloseAuthorization(authorizationID, closureReason) error

  // Request funds from the authorized payment method
  client.Capture(authorizationID, captureReferenceID, captureAmount, amazonpay.CaptureInput) (amazonpay.CaptureResponse, error)

  // Returns the detailed sales request status and the total amount refunded by sales request
  client.GetCaptureDetails(captureID) (amazonpay.GetCaptureDetailsResponse, error)

  // Complete order reference and will not be able to generate a new authorization from this Order Reference
  client.CloseOrderReference(orderReferenceID, closureReason) error

  // CancelOrderReference Cancels a previously confirmed order reference
  client.CancelOrderReference(orderReferenceID, reason) error

  // Refund refund the funds requested
  client.Refund(captureID, refundReferenceID, refundAmount, amazonpay.RefundInput) (amazonpay.RefundResponse, error)

  // Get refund details
  client.GetRefundDetails(refundID) (amazonpay.GetRefundDetailsResponse, error)
}

Verify IPN Notification

Verify ipn notification

amazonpay.VerifyIPNRequest(req)

Demo

We have deployed a demo that integrated Amazon Pay sandbox mode, visit it here: https://demo.getqor.com

You can place orders with our Amazon sandbox account: demo@getqor.com / qordemo

After placed orders, you can manage them via our admin interface, like take auth, capture, refund orders, the admin interface is generated with QOR Admin

Source code of this demo

https://github.com/qor/qor-example

License

Released under the MIT License.

主要指标

概览
名称与所有者qor/amazon-pay-sdk-go
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-02-07 09:01:52
推送于2020-10-02 13:21:59
最后一次提交2020-09-04 11:16:09
发布数0
用户参与
星数33
关注者数12
派生数12
提交数57
已启用问题?
问题数1
打开的问题数1
拉请求数6
打开的拉请求数2
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?