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

refactor(config): update payment method filter of Klarna in Stripe #2815

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Nov 8, 2023

Type of Change

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

Description

Update the pm_filters of Klarna in Stripe to include some more countries and currencies.
#2807

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?

Screenshot 2023-11-08 at 3 33 44 PM Screenshot 2023-11-08 at 3 40 03 PM Screenshot 2023-11-08 at 3 33 44 PM Screenshot 2023-11-08 at 3 40 03 PM Test case:- Make a Klarna payment using any one of the these countries and currencies for stripe. Also the admin api key that is being used needs to be of the particular country's. `klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "AUD,CAD,CHF,CZK,DKK,EUR,GBP,NOK,NZD,PLN,SEK,USD" }`
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_EMia8cy6oceZ3OPX0p5N5Y7wvjLqXfHxCnmO7quEd7oXhyvC8AWLFtLeWf2Nvscq' \
--header 'Cookie: JSESSIONID.130f0e8f=node01ix1y16yw8z3v1m3nwkr4qbiwb6.node0' \
--data-raw '{
    "amount": 180000,
    "currency": "AUD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "capture_method": "manual",
    "customer_id": "cus_NwicjmCJbghHr6",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "three_ds",
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "return_url": "https://google.com",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "pay_later",
    "payment_method_type": "klarna",
    "payment_experience": "redirect_to_url",
    "payment_method_data": {
        "pay_later": {
            "klarna_redirect": {
                "billing_email": "[email protected]",
                "billing_country": "AU"
            }
        }
    },
    "billing": {
        "address": {
            "line1": "444, Stelar Enclave",
            "line2": "California",
            "line3": "Groningen",
            "city": "Groningen",
            "state": "Groningen",
            "zip": "94105",
            "country": "AU",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "770101111",
            "country_code": "+61"
        }
    },
    "shipping": {
        "address": {
            "line1": "444, Stelar Enclave",
            "line2": "California",
            "line3": "Groningen",
            "city": "Groningen",
            "state": "Groningen",
            "zip": "94105",
            "country": "CA",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "7 7010 1111,",
            "country_code": "+61"
        }
    },
    "metadata": {},
    "order_details": [
        {
            "product_name": "Apple iphone 15",
            "quantity": 1,
            "amount": 180000,
            "account_name": "transaction_processing"
        }
    ]
}'

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 S-waiting-on-review Status: This PR has been implemented and needs to be reviewed M-configuration-changes Metadata: This PR involves configuration changes A-payment-methods Area: Payment Methods labels Nov 8, 2023
@ShankarSinghC ShankarSinghC added this to the November 2023 Release milestone Nov 8, 2023
@ShankarSinghC ShankarSinghC self-assigned this Nov 8, 2023
@ShankarSinghC ShankarSinghC requested a review from a team as a code owner November 8, 2023 13:43
@ShankarSinghC ShankarSinghC changed the base branch from main to hotfix-1.73.0 November 8, 2023 13:50
@likhinbopanna likhinbopanna merged commit cc17304 into hotfix-1.73.0 Nov 8, 2023
26 of 36 checks passed
@likhinbopanna likhinbopanna deleted the klarna-pmf branch November 8, 2023 14:29
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 8, 2023
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 M-configuration-changes Metadata: This PR involves configuration changes
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

5 participants