Skip to content

Conversation

@KiranKBR
Copy link
Contributor

@KiranKBR KiranKBR commented Jun 13, 2024

Type of Change

  • Refactoring

Description

This PR adds amount conversion framework to Placetopay

Note: Placetopay works in MinorUnit

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?

Flows to test in PalcetoPay

  • Payment
curl --location 'http://127.0.0.1:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_x2UnQLDkDrBLoun6EoIHXfmpEUbTwTDT2BVrUeNoQy0n8Eiyjx0K3uuJaAw5U5Lq' \
--data-raw '{
    "amount":32032,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 32032,
    "customer_id": "123sdfadf",
    "email": "[email protected]",
    "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": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "4110760000000081",
            "card_exp_month": "02",
            "card_exp_year": "26",
            "card_holder_name": "joseph",
            "card_cvc": "837"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "shipping": {
        "address": {
            "line1": "1467",
            "line2": "CA",
            "line3": "CA",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "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": "127.2.2.0",
        "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"
    }
}'
image

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

@KiranKBR KiranKBR requested review from a team as code owners June 13, 2024 06:14
@KiranKBR KiranKBR changed the title do-amount-conversion-for-placetopay refactor(connector): add amount conversion framework to placetopay Jun 13, 2024
@KiranKBR KiranKBR self-assigned this Jun 13, 2024
Base automatically changed from 5188-amount-conversion-do-amount-conversion-for-iatapay to main July 1, 2024 11:36
@KiranKBR KiranKBR requested review from a team as code owners July 1, 2024 11:36
@KiranKBR KiranKBR requested review from a team as code owners July 17, 2024 10:37
@hyperswitch-bot hyperswitch-bot bot added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jul 17, 2024
@KiranKBR KiranKBR force-pushed the do-amount-conversion-for-placetopay branch from 7cf9554 to 72fcd68 Compare July 17, 2024 13:40
@KiranKBR KiranKBR added S-waiting-on-review Status: This PR has been implemented and needs to be reviewed and removed M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Jul 17, 2024
sahkal
sahkal previously approved these changes Jul 17, 2024
@sahkal sahkal removed request for a team July 18, 2024 09:53
Copy link
Contributor

@SamraatBansal SamraatBansal left a comment

Choose a reason for hiding this comment

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

Line 295: transformer.rs has a usage of below check, please handle this with minor_amount
if item.request.refund_amount == item.request.payment_amount {

@KiranKBR KiranKBR requested a review from sahkal July 25, 2024 11:35
@likhinbopanna likhinbopanna added this pull request to the merge queue Jul 26, 2024
@pixincreate pixincreate added A-connector-integration Area: Connector integration C-refactor Category: Refactor labels Jul 26, 2024
Merged via the queue into main with commit 08334da Jul 26, 2024
@likhinbopanna likhinbopanna deleted the do-amount-conversion-for-placetopay branch July 26, 2024 14:00
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Jul 28, 2024
pixincreate added a commit that referenced this pull request Jul 30, 2024
* 'main' of github.com:juspay/hyperswitch:
  refactor(router): remove `connector_account_details` and `connector_webhook_details` in merchant_connector_account list response (#5457)
  feat: add env variable for enable key manager service (#5442)
  chore(version): 2024.07.29.0
  feat(payments): support sort criteria in payments list (#5389)
  refactor(connector):  add amount conversion framework to placetopay (#4988)
  feat(connector): [Bambora APAC] add mandate flow (#5376)
  ci: set code owners for payment methods files (#5453)
  refactor(opensearch): Add Error Handling for Empty Query and Filters in Request (#5432)
  chore: address Rust 1.80 clippy lints (#5447)
  feat(connector): [FISERV] Move connector to hyperswitch_connectors (#5441)
  ci: add support for just hack_v2 check for PRs (#5426)
  fix: added created at and modified at keys in PaymentAttemptResponse (#5412)
  refactor(merchant_account_v2): recreate id for `merchant_account` v2  (#5439)
  chore(version): 2024.07.26.0
  feat(events): forward the tenant configuration as part of the kafka message (#5224)
  refactor(connector):  add amount conversion framework to payone (#4981)
  refactor(user_roles): make org and merchant id nullable (#5353)
  fix(euclid): change the address taken in SessionFlowRouting from shipping to billing address (#5435)
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-refactor Category: Refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants