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: add prefix to connector_transaction_id #2981

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Conversation

dracarys18
Copy link
Member

Type of Change

  • Bugfix

Description

This adds prefix to connector_transaction_id and preprocessing_id while inserting to reverse lookup.

Motivation and Context

For some connectors like cashtocode the connector_transaction_id is same as payment_attempt_id it causes duplication in reverse lookup. So add a prefix to the connector_transaction_id to fix it.

How did you test it?

  • Payments with CashtoCode
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_RBXd1eGsgx19XwbcRPyr3xxHlnhrIBfPBE9VhsZrbvmQhfVWgNzER0Kp2gl4NhBW' \
--data-raw '{
    "payment_id":"pay_1700832163",
    "amount": 1000,
    "currency": "EUR",
    "confirm": true,
    "customer_id": "e064f3fe-a027-458a-a373-09eb38122b67",
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "reward",
    "payment_method_type": "classic",
    "payment_method_data": "reward",
    "billing": {
        "address": {
            "city": "北九州市",
            "country": "JP",
            "line1": "福岡県",
            "line2": null,
            "line3": null,
            "zip": "8000201",
            "state": null,
            "first_name": "SHIHO",
            "last_name": "YAMAGUCHI"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "city": "北九州市",
            "country": "JP",
            "line1": "福岡県",
            "line2": null,
            "line3": null,
            "zip": "8000201",
            "state": null,
            "first_name": "SHIHO",
            "last_name": "YAMAGUCHI"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
Screenshot 2023-11-24 at 6 55 23 PM
  • Test webhooks with a connector

Checklist

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

@dracarys18 dracarys18 added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 24, 2023
@dracarys18 dracarys18 added this to the November 2023 Release milestone Nov 24, 2023
@dracarys18 dracarys18 self-assigned this Nov 24, 2023
@dracarys18 dracarys18 requested a review from a team as a code owner November 24, 2023 13:27
@preetamrevankar preetamrevankar added this pull request to the merge queue Nov 24, 2023
Merged via the queue into main with commit 107c3b9 Nov 24, 2023
10 of 12 checks passed
@preetamrevankar preetamrevankar deleted the fix_cashtocode_500 branch November 24, 2023 14:13
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants