Closed prajjwalkumar17 closed 2 months ago
Adds a new column in Payment Intent for storing billing address details(Encrypted)
The Db Migration:
ALTER TABLE payment_intent ADD COLUMN IF NOT EXISTS billing_details BYTEA DEFAULT NULL;
The testing scenarios and flow is as follow:
curl --location 'http://localhost:8080/payments' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: xxxxxx' \ --data-raw '{ "amount": 6540, "currency": "EUR", "confirm": false, "capture_method": "automatic", "capture_on": "2022-09-10T10:11:12Z", "amount_to_capture": 6540, "customer_id":"uiuiuiui", "description": "Its my first payment request", "authentication_type": "no_three_ds", "return_url": "https://duck.com", "setup_future_usage": "off_session", "customer_acceptance": { "acceptance_type": "offline", "accepted_at": "1963-05-03T04:07:52.723Z", "online": { "ip_address": "13.232.74.226", "user_agent": "amet irure esse" } }, "billing": { "address": { "line1": "1467", "line2": "Harrison Street", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "NL", "first_name": "joseph", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "example@example.com" }, "statement_descriptor_name": "joseph", "statement_descriptor_suffix": "JS", "metadata": { "udf1": "value1", "new_customer": "true", "login_date": "2019-09-10T10:11:12Z" } }'
The new field should be added in DB in Payment Intent table, named as billing_details.
curl --location 'http://localhost:8080/payments/pay_rVW7YpmSmeRvDA0T0pW3' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: xxxxx' \ --data-raw '{ "payment_method": "card", "payment_method_data": { "card": { "card_number": "4242424242424242", "card_exp_month": "10", "card_exp_year": "2035", "card_holder_name": "John Doe", "card_cvc": "123" } }, "billing": { "address": { "line1": "1467", "line2": "delhi", "line3": "Harrison Street", "city": "San Fransico", "state": "California", "zip": "94122", "country": "IN", "first_name": "pk", "last_name": "Doe" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "example@example.com" }, "email": "payme2@example.com" }'
curl --location 'http://localhost:8080/payments/pay_rVW7YpmSmeRvDA0T0pW3/confirm' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'api-key: xxxxxx' \ --data-raw '{ "email": "guest@example.com", "billing": { "address": { "line1": "1467", "line2": "dumka" }, "phone": { "number": "8056594427", "country_code": "+91" }, "email": "example@example.com" }, "payment_method": "card", "payment_method_data": { "card": { "card_number": "4000003920000003", "card_exp_month": "10", "card_exp_year": "25", "card_cvc": "123" } } }'
cargo +nightly fmt --all
cargo clippy
Type of Change
Description
Adds a new column in Payment Intent for storing billing address details(Encrypted)
Additional Changes
The Db Migration:
Motivation and Context
How did you test it?
The testing scenarios and flow is as follow:
1. Payment Create
2. Payment Update
3. Payment Confirm
Checklist
cargo +nightly fmt --all
cargo clippy