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(connector): [novalnet] Remove first name, last name as required fields for Applepay, Googlepay, Paypal #7152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cookieg13
Copy link
Contributor

@cookieg13 cookieg13 commented Jan 31, 2025

Type of Change

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

Description

For Novalnet Connector, for Applepay, Googlepay, Paypal the following fields are not required

payment_method_data.billing.address.first_name
payment_method_data.billing.address.last_name

This PR removes these required fields for Applepay, Googlepay, Paypal for Novalnet

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?

Applepay can't be tested locally
Tested Googlepay and Paypal locally without passing

payment_method_data.billing.address.first_name
payment_method_data.billing.address.last_name

Testing Paypal

Request

curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_tAW8Ub52irOZ4OGMRHftVI2amltitI5Y8SvnWg9rAgz6tkKEVwbrQsVEgHFrPDOM' \
--data-raw '{
    "amount": 100,
    "currency": "EUR",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 100,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "paypal",
    "payment_method_data": {
        "wallet": {
            "paypal_redirect": {}
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "12345",
            "country": "DE"
        },
        "email": "test@novalnet.de",
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "Musterstr",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "94122",
            "country": "DE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "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,
        "ip_address": "103.77.139.95",
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

Response

Screenshot 2025-01-31 at 09 55 32

After Redirection

Screenshot 2025-01-31 at 09 55 43

Testing Googlepay

Request

curl --location --request POST 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_tAW8Ub52irOZ4OGMRHftVI2amltitI5Y8SvnWg9rAgz6tkKEVwbrQsVEgHFrPDOM' \
--data-raw '{
    "amount": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 100,
    "customer_id": "StripeCustomer",
    "email": "guest@example.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "payment_method": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "description": "Visa •••• 1111",
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": "{\"signature\":\"MEUCIQCKws9XNehiwnH8gkAMRk0kh8YhN0WpOB4ko+JVYRcrSwIgRCoqyjU7+cKS2zXboUeEEsjJq/gqkQVpZBQZColFjII\\u003d\",\"intermediateSigningKey\":{\"signedKey\":\"{\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEUrCoJa2WMkb4Y2f2Qq/MtpFyfRq1wwCMfvPYVehhxig2sgJ0SacbQtC1UZvjEq1XJxT+EdVsfU4cBR+87nLscQ\\\\u003d\\\\u003d\\\",\\\"keyExpiration\\\":\\\"1738969274860\\\"}\",\"signatures\":[\"MEQCIHyMLCxZi+g9S8ylPDy7Op+AFKCnwKYB7zwPl4JXyxqZAiAEljmRRc++ctSnDKO7+a6DPBeB8tXZy2mxDE7/yWd95Q\\u003d\\u003d\"]},\"protocolVersion\":\"ECv2\",\"signedMessage\":\"{\\\"encryptedMessage\\\":\\\"Nkr+4M8wqlTW6WYwBDyxF+CCdWF+kk+rCQFknbOit9H59PrQ+17vvJ5TvqzDB8MebKjoICRbgSXXqwYeLve/vb+uLllQgaL2l/aJvZQNBZ4n5MkGffPMqZ2vjcInCrg5bmFnkis2fNkP2dsbBXhRMt9Dg4esRB+WlcshiA92msjXaR/ZWWsDmRWMyezlJ9zDXiSBTVx12hvNA96gQHu1kWzf2WpGG6IF4ig+AoBcbCCsYbna2WL6bYA2tndV1x83U01vEncD2q3JS59jWdDEYkg6ybMHlTT5ZSA9mzyhVvSoKnKbBoOfNSw5Onnh2wT/2MqAuz3p/pGQB++U2B4cMw+8b3y1LRr2OIY5jdbLbhWhBLEcR9eu3NnNrQC7PLy/98r6gsfYKC0XOG/lXjVh0A3/VNV1siLRn565OVcw4S2LVhLvZxpVVJ0yxdVTYSST3vNKACgCGlFXZOWdeQPO8jyu5mC8FozCJihBlmRZ4nUp/pKwlGb4wkvMZkgt51bus/c01r8DC0c5rHGvLHyMekl6053WdReZ4kK2yMRtH5YQljV/9Us3Qsi2FThw/CGgTuiLDsc+/6d/tTMK6nU9gve5CIE7cspDUkbGJUvxGg\\\\u003d\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BAIZf7NWUbKxftmfIfYPGtNMudq14wMk6u3kwp53iSgKqyebEJuyTNjr/MVBtbdwFoNw7TPUHrQdochyhZL18aA\\\\u003d\\\",\\\"tag\\\":\\\"5V6sbwFahwJCD482VsTd4tYRDo+TZByQ9LnAIfWyfeU\\\\u003d\\\"}\"}"
                },
                "type": "CARD",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "12345",
            "country": "DE"
        },
        "email": "test@novalnet.de",
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "Musterstr",
            "line2": "CA",
            "line3": "CA",
            "city": "Musterhausen",
            "state": "California",
            "zip": "94122",
            "country": "DE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "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,
        "ip_address": "103.77.139.95",
        "screen_height": 723,
        "screen_width": 1536,
        "time_zone": 0,
        "java_enabled": true,
        "java_script_enabled": true
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'

Response

Screenshot 2025-01-31 at 10 10 08

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

@cookieg13 cookieg13 self-assigned this Jan 31, 2025
@cookieg13 cookieg13 requested a review from a team as a code owner January 31, 2025 08:05
Copy link

semanticdiff-com bot commented Jan 31, 2025

@cookieg13 cookieg13 changed the title fix(connector): [novalnet] remove first name, last name as required f… fix(connector): [novalnet] Remove first name, last name as required f… Jan 31, 2025
@cookieg13 cookieg13 changed the title fix(connector): [novalnet] Remove first name, last name as required f… fix(connector): [novalnet] Remove first name, last name as required fields Jan 31, 2025
@cookieg13 cookieg13 changed the title fix(connector): [novalnet] Remove first name, last name as required fields fix(connector): [novalnet] Remove first name, last name as required fields for Applepay, Googlepay, Paypal Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants