Skip to content

Latest commit

 

History

History
63 lines (58 loc) · 19 KB

File metadata and controls

63 lines (58 loc) · 19 KB

PaymentLink

Example Usage

import { PaymentLink } from "@gr4vy/sdk/models/components";

let value: PaymentLink = {
  id: "a1b2c3d4-5678-90ab-cdef-1234567890ab",
  url: "https://example.com/link/a1b2c3d4-5678-90ab-cdef-1234567890ab",
  amount: 1299,
  country: "DE",
  currency: "EUR",
  intent: "authorize",
  cartItems: [
    {
      name: "Widget",
      quantity: 2,
      unitAmount: 1299,
    },
  ],
  paymentSource: "card_on_file",
  createdAt: new Date("2024-05-30T12:34:56.000Z"),
  updatedAt: new Date("2024-05-30T13:00:00.000Z"),
  status: "processing",
};

Fields

Field Type Required Description Example
id string ✔️ The unique identifier for the payment link. a1b2c3d4-5678-90ab-cdef-1234567890ab
type "payment-link" Always payment-link. payment-link
url string ✔️ The URL for the payment link. https://example.com/link/a1b2c3d4-5678-90ab-cdef-1234567890ab
expiresAt Date The expiration date and time for the payment link. 2024-06-01T00:00:00.000Z
externalIdentifier string The merchant reference for the payment link. external-12345
statementDescriptor components.StatementDescriptor The statement descriptor for the payment link.
locale string The locale for the payment link. Example 1: en
Example 2: en-GB
Example 3: pt
Example 4: pt-BR
Example 5: es
merchantName string The merchant's display name. ACME Inc.
merchantUrl string The merchant's website URL. https://merchant.example.com
merchantBannerUrl string The merchant's banner image URL. https://merchant.example.com/banner.png
merchantColor string The merchant's brand color. #FF5733
merchantMessage string A message from the merchant. Thank you for your purchase!
merchantTermsAndConditionsUrl string URL to the merchant's terms and conditions. https://merchant.example.com/terms
merchantFaviconUrl string URL to the merchant's favicon. https://merchant.example.com/favicon.ico
amount number ✔️ The amount for the payment link. 1299
country string ✔️ The country code for the payment link. Example 1: DE
Example 2: GB
Example 3: US
currency string ✔️ The currency code for the payment link. Example 1: EUR
Example 2: GBP
Example 3: USD
intent components.TransactionIntent ✔️ N/A
returnUrl string The return URL after payment completion. https://merchant.example.com/return
cartItems components.CartItem[] ✔️ The cart items for the payment link. [
{
"amount": {
"currency": "USD",
"value": 500
},
"name": "Widget",
"quantity": 2
}
]
metadata Record<string, any> Arbitrary metadata for the payment link. {
"order_id": "ORD-12345"
}
paymentSource components.TransactionPaymentSource ✔️ The way payment method information made it to this transaction.
createdAt Date ✔️ The date and time the payment link was created. 2024-05-30T12:34:56.000Z
updatedAt Date ✔️ The date and time the payment link was last updated. 2024-05-30T13:00:00.000Z
status components.PaymentLinkStatus ✔️ N/A
buyer components.TransactionBuyer The buyer associated with the payment link.
shippingDetails components.ShippingDetails The shipping details for the payment link.
connectionOptions Record<string, Record<string, any>> The connection options for the payment link.
store boolean Whether the payment method was stored.
buyerId string The ID of the buyer to associate with the stored payment method. a1b2c3d4-5678-90ab-cdef-1234567890ab
installmentCount number The number of installments a buyer is required to make.