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): [Adyen] Add support for PIX Payment Method #3236

Merged
merged 23 commits into from
Jan 25, 2024
Merged

Conversation

swangi-kumari
Copy link
Contributor

@swangi-kumari swangi-kumari commented Jan 4, 2024

Type of Change

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

Description

Additional Changes

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

Motivation and Context

How did you test it?

{
    "amount": 6500,
    "currency": "BRL",
    "confirm": true,
    "capture_method": "manual",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "customer_id": "StripeCustomer",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "profile_id": "pro_sx78reJN0zgRzB5UGicx",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://duck.com",
    "billing": {
        "address": {
            "first_name": "John",
            "last_name": "Doe",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "BR"
        }
    },
    "browser_info": {
        "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36",
        "accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
        "language": "nl-NL",
        "color_depth": 24,
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true,
        "ip_address": "127.0.0.1"
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "BR",
            "first_name": "John",
            "last_name": "Doe"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
        "payment_method": "bank_transfer",
    "payment_method_type": "pix",
    "payment_method_data": {
        "bank_transfer": {
            "pix": {}
        }
    }
}
Screenshot 2024-01-23 at 6 24 59 PM

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

@swangi-kumari swangi-kumari self-assigned this Jan 4, 2024
@swangi-kumari swangi-kumari requested review from a team as code owners January 4, 2024 06:13
@swangi-kumari swangi-kumari added A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Jan 4, 2024
#[serde(rename_all = "snake_case")]
#[serde(untagged)]
pub enum QrCodeInformation {
QrCodeUrl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add comments stating that the enum order shouldn't be changed as this is being used during serialization and deserialization

.action
.qr_code_url
.clone()
.ok_or(errors::ConnectorError::ResponseHandlingFailed)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we are throwing error incase of None? This is an optional field from connector

display_to_timestamp: None,
};
let qr_code_instructions = payments::NextActionFromConnectorMetaData::QrCodeInformation(
payments::QrCodeInformation::QrCodeUrl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the data available, please construct QrCodeInformation::QrCodeUrl or QrCodeInformation::QrDataUrl or QrCodeInformation::QrCodeImageUrl.

payments::QrCodeInformation::QrCodeUrl {
image_data_url,
qr_code_url,
display_to_timestamp: None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we get expiration time limit for the QR code from Aden?

},
api_models::payments::NextActionFromConnectorMetaData::QrCodeInformation (qr_info) => {

match qr_info {
Copy link
Contributor

Choose a reason for hiding this comment

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

Move this to from implementation

ArjunKarthik
ArjunKarthik previously approved these changes Jan 18, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Jan 25, 2024
Merged via the queue into main with commit fc6e68f Jan 25, 2024
10 checks passed
@Gnanasundari24 Gnanasundari24 deleted the pix branch January 25, 2024 07:29
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants