hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(FRM): add missing fields in Signifyd payment request

Open srujanchikke opened this issue 9 months ago • 0 comments

Type of Change

  • [ ] Bugfix
  • [ ] New feature
  • [x] Enhancement
  • [ ] Refactoring
  • [ ] Dependency updates
  • [ ] Documentation
  • [ ] CI/CD

Description

Following fields are added in siginfyd sale/transaction request :

order_id, subcategory, category, confirmation_phone_number , confirmation email, shipping method, total shipping cost

Additional Changes

  • [X] This PR modifies the API contract
  • [ ] This PR modifies the database schema
  • [ ] This PR modifies application configuration/environment variables
"order_details" : [{
        "product_name" : "gillete creme",
        "quantity" : 2,
        "amount" : 600,
        "product_id" : "product_id",
        "category" : "clothes", 
        "sub_category" : "tees" // newly added
    }]

Motivation and Context

How did you test it?

Postman Test cases : configure for both pre and post frm flows and make payment

{
  "amount": 605,
  "currency": "USD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 605,
  "customer_id": "StripeCustomer2",
  "name": "Bob Smith",
  "phone": "999999999",
  "phone_country_code": "+91",
  "description": "Its my first payment request",
  "authentication_type": "no_three_ds",
  "return_url": "https://google.com",
  "payment_method": "card",
  "payment_method_data": {
    "card": {
      "card_number": "4242424242424242",
      "card_exp_month": "10",
      "card_exp_year": "25",
      "card_holder_name": "joseph Doe",
      "card_cvc": "123"
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "31 Sherwood Gardens",
      "line3": "31 Sherwood Gardens",
      "city": "London",
      "state": "Manchester",
      "zip": "E14 9wn",
      "country": "GB",
      "first_name": "Bob",
      "last_name": "Smith"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "email" : "[email protected]",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  },
  "order_details" : [{
        "product_name" : "gillete creme",
        "quantity" : 2,
        "amount" : 600,
        "product_id" : "{{random_number}}",
        "category" : "clothes",
        "sub_category" : "tees"
    },
    {
        "product_name" : "gillete razor",
        "quantity" : 1,
        "amount" : 300,
        "product_id" : "{{random_number}}",
        "category" : "clothes",
        "sub_category" : "tees"
    }],
    "frm_metadata" : {
        "fulfillment_method" : "delivery",
        "coverage_request" : "fraud",
        "total_shipping_cost" : 240
    }
}
  • verify it from signifyd dashboard sale/checkout/transaction api's
Screenshot 2024-05-06 at 4 03 18 PM Screenshot 2024-05-06 at 4 03 33 PM

Checklist

  • [x] I formatted the code cargo +nightly fmt --all
  • [x] I addressed lints thrown by cargo clippy
  • [x] I reviewed the submitted code
  • [ ] I added unit tests for my changes where possible

srujanchikke avatar May 06 '24 06:05 srujanchikke