diff --git a/order.go b/order.go index 1cc1412..906aea0 100644 --- a/order.go +++ b/order.go @@ -31,7 +31,7 @@ func (c *Client) CreateOrder(intent string, purchaseUnits []PurchaseUnitRequest, 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 { return order, err diff --git a/types.go b/types.go index c4204be..42ed11c 100644 --- a/types.go +++ b/types.go @@ -337,13 +337,13 @@ type ( PurchaseUnitRequest struct { ReferenceID string `json:"reference_id,omitempty"` Amount *PurchaseUnitAmount `json:"amount"` - Payee PayeeForOrders `json:"payee,omitempty"` + Payee *PayeeForOrders `json:"payee,omitempty"` Description string `json:"description,omitempty"` CustomID string `json:"custom_id,omitempty"` InvoiceID string `json:"invoice_id,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty"` Items []Item `json:"items,omitempty"` - Shipping ShippingDetail `json:"shipping,omitempty"` + Shipping *ShippingDetail `json:"shipping,omitempty"` } // MerchantPreferences struct