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

fix(payment_methods): make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json #4154

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Mar 20, 2024

Type of Change

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

Description

make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json because retrieve payment fails for the old payments for which the payment_method_data in the payment_attempt table was stored as {"wallet": {}}

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

Closes #4153.

How did you test it?

Checkout to old commit where we were storing the {"wallet": {}} for apple pay in the payment_attempt table
image

Make a payment create call for apple pay

{
    "amount": 650,
    "currency": "USD",
    "confirm": false,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 650,
    "customer_id": "custhype1232",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "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"
        }
    },
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "payment_data":"payment_data",
                "payment_method": {
                    "display_name": "Visa 0326",
                    "network": "Mastercard",
                    "type": "debit"
                },
                "transaction_identifier": "55CC32D7BF7890B9064433F15B9F23F849CF84AFD01E4E65DD8ADE306300E9D8"
            }
        }
    }
}

Checkout to the latest main and retrieve the payment with the payment_id

curl --location 'http:https://localhost:8080/payments/pay_rhuPyFWzD4SM0spkpjXi' \
--header 'Accept: application/json' \
--header 'api-key: dev_jhuZ9QNa1RSObflo1fGgAc7ZsZDGLQ20XKErfgB3uXyfOZEtAWM73JI8QbD2t9j0' \
--data ''
image image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@ShankarSinghC ShankarSinghC added C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-payment-methods Area: Payment Methods labels Mar 20, 2024
@ShankarSinghC ShankarSinghC self-assigned this Mar 20, 2024
@ShankarSinghC ShankarSinghC requested review from a team as code owners March 20, 2024 10:54
@likhinbopanna likhinbopanna added this pull request to the merge queue Mar 20, 2024
Merged via the queue into main with commit 7c0e4c7 Mar 20, 2024
35 of 43 checks passed
@likhinbopanna likhinbopanna deleted the apple_pay/fix-store-apple-pay-wallet-data branch March 20, 2024 13:42
@ShankarSinghC ShankarSinghC changed the title fix(payment_methods): make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json fix(payment_methods): make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json Mar 20, 2024
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make ApplepayPaymentMethod in payment_method_data column of payment_attempt table as json
5 participants