Module: Frontgo::HostedCheckout

Included in:
Client
Defined in:
lib/frontgo/hosted_checkout.rb

Overview

Instance Method Summary collapse

Instance Method Details

#create_hosted_checkout(params) ⇒ Object

Examples:

Create a hosted checkout payment link

client.create_hosted_checkout({
  products: [{ name: "Router", quantity: 1, rate: 4500, tax: 12, amount: 4500 }],
  orderSummary: { subTotal: 4017.86, totalTax: 482.14, grandTotal: 4500.00 },
  customerDetails: {
    type: "private",
    name: "Kari Nordmann",
    email: "kari@example.com"
  },
  callback: {
    callbackUrl: "https://example.com/callback",
    success: "https://example.com/success",
    failure: "https://example.com/failure"
  }
})
# => response.body.dig("data", "orderUuid")
# => response.body.dig("data", "paymentUrl")


23
24
25
# File 'lib/frontgo/hosted_checkout.rb', line 23

def create_hosted_checkout(params)
  post "connect/hosted/orders/payment-link/create", params
end