From d2508546c3fb2a28bcc787c4b1f68194f0b6ce07 Mon Sep 17 00:00:00 2001 From: Jerry <85411418@qq.com> Date: Tue, 10 May 2022 21:08:03 +0800 Subject: [PATCH] format --- doc/paypal.md | 15 +++++++++------ paypal/subscriptions.go | 5 +++-- paypal/subscriptions_test.go | 3 ++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/paypal.md b/doc/paypal.md index 21556177..47c975ec 100644 --- a/doc/paypal.md +++ b/doc/paypal.md @@ -1,6 +1,6 @@ ## PayPal -> 具体API使用介绍,请参考`gopay/paypal/client_test.go`,`gopay/paypal/order_test.go`,`gopay/paypal/payment_test.go` +> 具体API使用介绍,请参考`gopay/paypal/client_test.go`,`gopay/paypal/order_test.go`,`gopay/paypal/payment_test.go` 等xxx_test.go - 已实现API列表附录:[API List](https://github.com/go-pay/gopay/blob/main/doc/paypal.md#%E9%99%84%E5%BD%95) @@ -32,13 +32,16 @@ client.DebugSwitch = gopay.DebugOn > Payments:[Payments API](https://developer.paypal.com/api/payments/v2/) +> Subscriptions:[Subscriptions API](https://developer.paypal.com/docs/api/subscriptions/v1/) + - Create Orders example + ```go import ( - "github.com/go-pay/gopay" - "github.com/go-pay/gopay/paypal" - "github.com/go-pay/gopay/pkg/util" - "github.com/go-pay/gopay/pkg/xlog" +"github.com/go-pay/gopay" +"github.com/go-pay/gopay/paypal" +"github.com/go-pay/gopay/pkg/util" +"github.com/go-pay/gopay/pkg/xlog" ) // Create Orders example @@ -123,4 +126,4 @@ return * 支付捕获退款(Refund captured payment):`client.PaymentCaptureRefund()` * 支付退款详情(Show refund details):`client.PaymentRefundDetail()` * 订阅 - * 创建订单(Create order):`client.CreateBillingPlan()` \ No newline at end of file + * 创建订阅计划(Create plan):`client.CreateBillingPlan()` \ No newline at end of file diff --git a/paypal/subscriptions.go b/paypal/subscriptions.go index d852e7ad..6290bcf8 100644 --- a/paypal/subscriptions.go +++ b/paypal/subscriptions.go @@ -4,11 +4,12 @@ import ( "context" "encoding/json" "fmt" - "github.com/go-pay/gopay" "net/http" + + "github.com/go-pay/gopay" ) -// 创建订阅计划(CreateBillingPlan) +// 创建订阅计划(CreateBillingPlan) // Code = 0 is success // 文档:https://developer.paypal.com/docs/api/subscriptions/v1/#plans_create func (c *Client) CreateBillingPlan(ctx context.Context, bm gopay.BodyMap) (ppRsp *CreateBillingRsp, err error) { diff --git a/paypal/subscriptions_test.go b/paypal/subscriptions_test.go index f6ac01e2..f01c4d3b 100644 --- a/paypal/subscriptions_test.go +++ b/paypal/subscriptions_test.go @@ -1,9 +1,10 @@ package paypal import ( + "testing" + "github.com/go-pay/gopay" "github.com/go-pay/gopay/pkg/xlog" - "testing" ) func TestClient_CreateBillingPlan(t *testing.T) {