forked from go-packages/paypal
Merge pull request #93 from roopakv/roopakv/tiny_fix
[Tiny fix] Create Order
This commit is contained in:
commit
888360be1f
2
order.go
2
order.go
|
@ -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
|
||||||
|
|
4
types.go
4
types.go
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user