Merge pull request #100 from roopakv/roopakv/update_co

Use create order payer for create order
This commit is contained in:
Alex Pliutau 2019-07-22 14:56:14 +02:00 committed by GitHub
commit fd64790cd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,10 +21,10 @@ func (c *Client) GetOrder(orderID string) (*Order, error) {
// Create Order - Use this call to create an order // Create Order - Use this call to create an order
// Endpoint: POST /v2/checkout/orders // Endpoint: POST /v2/checkout/orders
func (c *Client) CreateOrder(intent string, purchaseUnits []PurchaseUnitRequest, payer *PayerInfo, appContext *ApplicationContext) (*Order, error) { func (c *Client) CreateOrder(intent string, purchaseUnits []PurchaseUnitRequest, payer *CreateOrderPayer, appContext *ApplicationContext) (*Order, error) {
type createOrderRequest struct { type createOrderRequest struct {
Intent string `json:"intent"` Intent string `json:"intent"`
Payer *PayerInfo `json:"payer,omitempty"` Payer *CreateOrderPayer `json:"payer,omitempty"`
PurchaseUnits []PurchaseUnitRequest `json:"purchase_units"` PurchaseUnits []PurchaseUnitRequest `json:"purchase_units"`
ApplicationContext *ApplicationContext `json:"application_context,omitempty"` ApplicationContext *ApplicationContext `json:"application_context,omitempty"`
} }