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(connector): changed amount to minor Unit for stripe #4786

Merged

Conversation

sahkal
Copy link
Contributor

@sahkal sahkal commented May 28, 2024

Type of Change

  • Refactoring

Description

This Pull request Uses the amount framework while sending request to stripe

Note: Stripe works in minor Unit

Additional Changes

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

Motivation and Context

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OQjekPHEaK7qHI72VzXf63r6upc0sejXgi7GY5vOGsgwstsYtqMXvTv1bxwS5shF' \
--data-raw '
{
    "amount": 250,
    "currency": "USD",
    "confirm": true,
    "amount_to_capture": 250,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "StripeCustomer123",
    "email": "abcdef123@gmail.com",
    "name": "John Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Please Pay for your XYZ",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "setup_future_usage": "off_session",
    "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"
    },
    "routing": {
        "type": "single",
        "data": "nmi"
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4242424242424242",
            "card_exp_month": "08",
            "card_exp_year": "25",
            "card_holder_name": "joseph Doe",
            "card_cvc": "999"
        }
    }
}'
Screenshot 2024-06-07 at 3 52 10 PM

How did you test it?

Flows to test:

  • Cards
  • Bank Transfers
  • ApplePay & Google Pay
  • Refunds
  • Payouts

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

sahkal and others added 30 commits May 13, 2024 16:50
Narayanbhat166
Narayanbhat166 previously approved these changes Jun 5, 2024
…7-amount-conversion-do-amount-conversion-for-stripe
@sahkal sahkal requested a review from a team as a code owner June 7, 2024 10:24
Narayanbhat166
Narayanbhat166 previously approved these changes Jun 10, 2024
apoorvdixit88
apoorvdixit88 previously approved these changes Jun 10, 2024
Copy link
Contributor

@apoorvdixit88 apoorvdixit88 left a comment

Choose a reason for hiding this comment

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

Dashboard specific changes are fine

jarnura
jarnura previously approved these changes Jun 10, 2024
AkshayaFoiger
AkshayaFoiger previously approved these changes Jun 10, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 10, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 11, 2024
Merged via the queue into main with commit b705757 Jun 11, 2024
10 checks passed
@likhinbopanna likhinbopanna deleted the 5177-amount-conversion-do-amount-conversion-for-stripe branch June 11, 2024 08:12
@SanchithHegde SanchithHegde removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed high-risk labels Jun 16, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants