Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed May 10, 2022
1 parent 428385e commit d250854
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
15 changes: 9 additions & 6 deletions doc/paypal.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -123,4 +126,4 @@ return
* 支付捕获退款(Refund captured payment):`client.PaymentCaptureRefund()`
* 支付退款详情(Show refund details):`client.PaymentRefundDetail()`
* <font color='#003087' size='4'>订阅</font>
* 创建订单(Create order):`client.CreateBillingPlan()`
* 创建订阅计划(Create plan):`client.CreateBillingPlan()`
5 changes: 3 additions & 2 deletions paypal/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion paypal/subscriptions_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down

0 comments on commit d250854

Please sign in to comment.