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(connector): [BANKOFAMERICA] Implement Google Pay #2940

Merged
merged 10 commits into from
Nov 22, 2023
Merged

Conversation

deepanshu-iiitu
Copy link
Contributor

@deepanshu-iiitu deepanshu-iiitu commented Nov 21, 2023

Type of Change

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

Description

Implement Payment Method Google Pay for connector Bankofamerica

Additional Changes

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

Motivation and Context

https://github.com/juspay/hyperswitch-cloud/issues/3297

How did you test it?

Authorize(Manual+Automatic), Capture and PSYNC flow needs to be tested for Payment Method Google Pay for connector Bankofamerica

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: API_KEY_HERE' \
--data-raw '{
    
    
    "amount": 900,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    
    "customer_id": "CustomerX",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "Visa •••• 1111",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                },
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": "GOOGLE_PAY_TOKEN_HERE"
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "Dubai",
            "zip": "94122",
            "country": "AE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "AE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "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"
    },
    "business_label": "food",
    "business_country": "US"
}'

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

@deepanshu-iiitu deepanshu-iiitu requested a review from a team as a code owner November 21, 2023 15:48
@deepanshu-iiitu deepanshu-iiitu self-assigned this Nov 21, 2023
@deepanshu-iiitu deepanshu-iiitu added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Nov 21, 2023
pub struct PaymentInformation {
card: Card,
card: Option<Card>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create enum for PaymentInformation, one for card and one for fluid data

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

let email = item.router_data.request.get_email()?;
let bill_to = build_bill_to(item.router_data.get_billing()?, email)?;

let order_information = OrderInformationWithBill {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle this with From impl so redundant code can be reduced

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

fluid_data: None,
};

let processing_information = ProcessingInformation {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use From implementation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

payment_solution: None,
};

let client_reference_information = ClientReferenceInformation {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use From impl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@ArjunKarthik ArjunKarthik added the S-waiting-on-author Status: This PR is incomplete or needs to address review comments label Nov 22, 2023
@deepanshu-iiitu deepanshu-iiitu added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed S-waiting-on-author Status: This PR is incomplete or needs to address review comments labels Nov 22, 2023
},
});

let payment_solution = Some("012".to_string());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have this as enum, which will be useful while implementing applepay

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 319 to 322
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::GooglePayWalletData,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::GooglePayWalletData,
),
(item, google_pay_data): (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::GooglePayWalletData,
),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 272 to 275
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::Card,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::Card,
),
(item, ccard): (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
payments::Card,
),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 232 to 235
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
Option<String>,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
Option<String>,
),
(item, payment_solution): (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
Option<String>,
),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 209 to 212
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
BillTo,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
value: (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
BillTo,
),
(item, bill_to): (
&BankOfAmericaRouterData<&types::PaymentsAuthorizeRouterData>,
BillTo,
),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 22, 2023
Merged via the queue into main with commit f91d4ae Nov 22, 2023
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the boa_gpay branch November 22, 2023 16:49
@SanchithHegde SanchithHegde added C-feature Category: Feature request or enhancement and removed C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

5 participants