hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

feat(payments_update): update payment_method_billing in payment update

Open Narayanbhat166 opened this issue 1 year ago • 0 comments

Type of Change

  • [x] New feature

Description

This PR allows the payment_method_billing to be updated in the payments update flow.

Motivation and Context

How did you test it?

  • Create a payment with confirm as false
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'api-key: dev_VTitmyLzKQhsrNhv6DmgKbzAxaXOLKuWkcY37HT3f7vgWvXBIoYuIg4FU61EGVF6' \
--data-raw '{
    "amount": 6540,
    "currency": "USD",
    "confirm": false,
    "customer": {
        "id": "cus_PAxm0MeCGM5TowgDKPc9",
        "email": "[email protected]"
    }
}'
  • Update the payment with payment_method_data.billing
curl --location 'http://localhost:8080/payments/pay_62qJ2OaJTzci4aKkXjm9' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_VTitmyLzKQhsrNhv6DmgKbzAxaXOLKuWkcY37HT3f7vgWvXBIoYuIg4FU61EGVF6' \
--data '{
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "IN",
            "first_name": "Narayan",
            "last_name": "Bhat"
        }
    }
}'
  • Retrieve the payment and ensure that the billing details are updated

Checklist

  • [x] I formatted the code cargo +nightly fmt --all
  • [x] I addressed lints thrown by cargo clippy
  • [x] I reviewed the submitted code

Narayanbhat166 avatar May 09 '24 14:05 Narayanbhat166