Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(payments_update): update payment_method_billing in payment update #4614

Merged
merged 4 commits into from May 13, 2024

Conversation

Narayanbhat166
Copy link
Member

@Narayanbhat166 Narayanbhat166 commented May 9, 2024

Type of Change

  • 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": "example@juspay.in"
    }
}'
  • 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 '{
    "payment_method_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

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

@Narayanbhat166 Narayanbhat166 added the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 9, 2024
@Narayanbhat166 Narayanbhat166 added this to the May 2024 Release milestone May 9, 2024
@Narayanbhat166 Narayanbhat166 self-assigned this May 9, 2024
@Narayanbhat166 Narayanbhat166 requested review from a team as code owners May 9, 2024 14:34
hrithikesh026
hrithikesh026 previously approved these changes May 10, 2024
crates/api_models/src/payments.rs Outdated Show resolved Hide resolved
@likhinbopanna likhinbopanna removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label May 13, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue May 13, 2024
Merged via the queue into main with commit 2692995 May 13, 2024
9 of 12 checks passed
@likhinbopanna likhinbopanna deleted the update_pmd_in_payment_update branch May 13, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants