Merge pull request #93 from roopakv/roopakv/tiny_fix

[Tiny fix] Create Order
This commit is contained in:
Alex Pliutau 2019-06-29 10:24:53 +02:00 committed by GitHub
commit 888360be1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ func (c *Client) CreateOrder(intent string, purchaseUnits []PurchaseUnitRequest,
order := &Order{} order := &Order{}
req, err := c.NewRequest("POST", "/v2/checkout/orders", createOrderRequest{Intent: intent, PurchaseUnits: purchaseUnits, Payer: payer, ApplicationContext: appContext}) req, err := c.NewRequest("POST", fmt.Sprintf("%s%s", c.APIBase, "/v2/checkout/orders"), createOrderRequest{Intent: intent, PurchaseUnits: purchaseUnits, Payer: payer, ApplicationContext: appContext})
if err = c.SendWithAuth(req, order); err != nil { if err = c.SendWithAuth(req, order); err != nil {
return order, err return order, err

View File

@ -337,13 +337,13 @@ type (
PurchaseUnitRequest struct { PurchaseUnitRequest struct {
ReferenceID string `json:"reference_id,omitempty"` ReferenceID string `json:"reference_id,omitempty"`
Amount *PurchaseUnitAmount `json:"amount"` Amount *PurchaseUnitAmount `json:"amount"`
Payee PayeeForOrders `json:"payee,omitempty"` Payee *PayeeForOrders `json:"payee,omitempty"`
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
CustomID string `json:"custom_id,omitempty"` CustomID string `json:"custom_id,omitempty"`
InvoiceID string `json:"invoice_id,omitempty"` InvoiceID string `json:"invoice_id,omitempty"`
SoftDescriptor string `json:"soft_descriptor,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty"`
Items []Item `json:"items,omitempty"` Items []Item `json:"items,omitempty"`
Shipping ShippingDetail `json:"shipping,omitempty"` Shipping *ShippingDetail `json:"shipping,omitempty"`
} }
// MerchantPreferences struct // MerchantPreferences struct