Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current Restore this Version View Page History

« Previous Version 2 Next »

A gift card will be a random alphanumeric sequence with 15 characters. We'll generally present it in the format: AAAA-1234567-BBBB.

We'll need to display a new text box where customers can input their gift card number when performing the checkout. When the customer inputs a gift card number, we'll need to check its balance through this endpoint:

(sample response)
{
    "success"true,
    "message""",
    "data": {
        "giftCardId"15,
        "initialAmount"52.0,
        "totalRecharge"0.0,
        "totalCapture"11.33,
        "totalRefund"0.0,
        "balance"40.67
    }
}

If the gift card has enough balance to pay the full price of the order, we must redirect the customer to a page where he can input ALL information that we need to fulfill an order, like name, address, IP and so on. We also will use the new "payment provider" (62) for gift card, like in the payload below:

{
  "ShippingMethodId"137,
  "GiftCardNumber""A111-9CFXEM9-73R5",
  "UseShippingAddressForBilling"true,
  "ProductId"917909,
  "Customer": {
    "CustomerIdentificationValue""31427411867",
    "Email""novo_teste12@test.com",
    "PhoneNumber""41232233",
    "FirstName""Eduardo",
    "MiddleName""Teste",
    "LastName""Testador",
    "IP""161.185. 160.93"
  },
  "Payment": {
    "PaymentProcessorId"62
  },
  "ShippingAddress": {
    "FirstName""Eduardo",
    "MiddleName""Teste",
    "LastName""Testador",
    "Address1""767 5th Ave",
    "Address2""",
    "City""New York",
    "ZipCode""10153",
    "State""NY",
    "CountryCode""US",
    "PhoneNumber""+1 212-336-1440"
  }

If the gift card has only credits to partially pay the order, we just need to add the number in the new field "GiftCardNumber" at the root of the json payload, just as shown above. In this scenario, everything else remains the same. If they are going to pay using a credit card, just keep posting all the data as usual. If they have chosen an offline provider, just inform the paymentProcessorId as usual.


0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.