mirror of
https://github.com/plutov/paypal.git
synced 2025-01-23 10:21:03 +01:00
Fix linter issues
This commit is contained in:
parent
1bdb88fd4b
commit
36bba2d583
|
@ -2,8 +2,9 @@ package paypalsdk_test
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
pp "github.com/logpacker/PayPal-Go-SDK"
|
||||
"time"
|
||||
|
||||
pp "github.com/logpacker/PayPal-Go-SDK"
|
||||
)
|
||||
|
||||
func BillingExample() {
|
||||
|
@ -72,8 +73,8 @@ func BillingExample() {
|
|||
Value: "1",
|
||||
Currency: "USD",
|
||||
},
|
||||
ReturnUrl: "http://www.paypal.com",
|
||||
CancelUrl: "http://www.paypal.com/cancel",
|
||||
ReturnURL: "http://www.paypal.com",
|
||||
CancelURL: "http://www.paypal.com/cancel",
|
||||
AutoBillAmount: "YES",
|
||||
InitialFailAmountAction: "CONTINUE",
|
||||
MaxFailAttempts: "0",
|
||||
|
@ -96,7 +97,7 @@ func BillingExample() {
|
|||
agreement := pp.BillingAgreement{
|
||||
Name: "Fast Speed Agreement",
|
||||
Description: "Agreement for Fast Speed Plan",
|
||||
StartDate: pp.JsonTime(time.Now().Add(time.Hour * 24)),
|
||||
StartDate: pp.JSONTime(time.Now().Add(time.Hour * 24)),
|
||||
Plan: pp.BillingPlan{ID: planResp.ID},
|
||||
Payer: pp.Payer{
|
||||
PaymentMethod: "paypal",
|
||||
|
|
|
@ -58,7 +58,6 @@ func (c *Client) SetHTTPClient(client *http.Client) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
// SetAccessToken sets saved token to current client
|
||||
func (c *Client) SetAccessToken(token string) error {
|
||||
c.Token = &TokenResponse{
|
||||
|
|
13
types.go
13
types.go
|
@ -44,8 +44,8 @@ const (
|
|||
)
|
||||
|
||||
type (
|
||||
// JsonTime overrides MarshalJson method to format in ISO8601
|
||||
JsonTime time.Time
|
||||
// JSONTime overrides MarshalJson method to format in ISO8601
|
||||
JSONTime time.Time
|
||||
|
||||
// Address struct
|
||||
Address struct {
|
||||
|
@ -113,7 +113,7 @@ type (
|
|||
BillingAgreement struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
StartDate JsonTime `json:"start_date,omitempty"`
|
||||
StartDate JSONTime `json:"start_date,omitempty"`
|
||||
Plan BillingPlan `json:"plan,omitempty"`
|
||||
Payer Payer `json:"payer,omitempty"`
|
||||
ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
|
||||
|
@ -287,8 +287,8 @@ type (
|
|||
// MerchantPreferences struct
|
||||
MerchantPreferences struct {
|
||||
SetupFee *AmountPayout `json:"setup_fee,omitempty"`
|
||||
ReturnUrl string `json:"return_url,omitempty"`
|
||||
CancelUrl string `json:"cancel_url,omitempty"`
|
||||
ReturnURL string `json:"return_url,omitempty"`
|
||||
CancelURL string `json:"cancel_url,omitempty"`
|
||||
AutoBillAmount string `json:"auto_bill_amount,omitempty"`
|
||||
InitialFailAmountAction string `json:"initial_fail_amount_action,omitempty"`
|
||||
MaxFailAttempts string `json:"max_fail_attempts,omitempty"`
|
||||
|
@ -539,7 +539,8 @@ func (r *ErrorResponse) Error() string {
|
|||
return fmt.Sprintf("%v %v: %d %s", r.Response.Request.Method, r.Response.Request.URL, r.Response.StatusCode, r.Message)
|
||||
}
|
||||
|
||||
func (t JsonTime) MarshalJSON() ([]byte, error) {
|
||||
// MarshalJSON for JSONTime
|
||||
func (t JSONTime) MarshalJSON() ([]byte, error) {
|
||||
stamp := fmt.Sprintf(`"%s"`, time.Time(t).UTC().Format(time.RFC3339))
|
||||
return []byte(stamp), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user