hyperswitch icon indicating copy to clipboard operation
hyperswitch copied to clipboard

refactor(connector): Use connector_request_reference_id for PayU

Open vinfinity7 opened this issue 1 year ago • 14 comments

Type of Change

Fixes #2313

  • [ ] Bugfix
  • [ ] New feature
  • [x] 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?

Make any Payment for connector PayU and see that you are getting "reference_id" field in the logs of payment request.

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

vinfinity7 avatar Oct 29 '23 18:10 vinfinity7

Hey @vinfinity7 , Please comment on the issue 2313, so that we can assign that issue to you.

swangi-kumari avatar Oct 31 '23 09:10 swangi-kumari

Pls address the CI fails Run cargo +nightly fmt for formatting.

swangi-kumari avatar Oct 31 '23 09:10 swangi-kumari

Hi @vinfinity7 , Thanks for your interest in contributing to hyperswitch. Let us know if you need any assistance from our end. Also, even if hacktoberfest is over, we should celebrate open source everyday and we are open for more contributions from you. We would still be rewarding folks with goodies even if the PR gets merged post hacktoberfest. May the Source be with you!

swangi-kumari avatar Nov 02 '23 11:11 swangi-kumari

@swangi-kumari kindly review pr

vinfinity7 avatar Feb 01 '24 22:02 vinfinity7

@swangi-kumari if the pr's alright , you might wanna consider merging it 👍 or give me heads up as to what can i modify ?

vinfinity7 avatar Feb 22 '24 19:02 vinfinity7

@swangi-kumari as srujan has approved the changes , i would like to request your review too for a quick merge!

vinfinity7 avatar Mar 16 '24 10:03 vinfinity7

@srujanchikke whats up with this ?

vinfinity7 avatar Mar 24 '24 11:03 vinfinity7

@Gnanasundari24 @likhinbopanna Could you please merge this PR ?

srujanchikke avatar Mar 28 '24 13:03 srujanchikke

@Gnanasundari24 @likhinbopanna Could you please merge this PR ?

vinfinity7 avatar Apr 02 '24 17:04 vinfinity7

Make any Payment for connector PayU and see that you are getting "reference_id" field i

Hi @vinfinity7 , Can you add curl request and response json for testing and also screenshots. CC : @likhinbopanna

srujanchikke avatar Apr 03 '24 09:04 srujanchikke

hi @srujanchikke being new to this repo , i am not aware of the route to hit , please be clear of the curl request command

vinfinity7 avatar Apr 03 '24 16:04 vinfinity7

hi @srujanchikke being new to this repo , i am not aware of the route to hit , please be clear of the curl request command

You can provide /payments request & response jsons and screenshot of log where raw_connector_request (masked request) is logged.

Please don't expose any api keys in the json or curl .

srujanchikke avatar Apr 04 '24 10:04 srujanchikke

hi @srujanchikke being new to this repo , i am not aware of the route to hit , please be clear of the curl request command

You can provide /payments request & response jsons and screenshot of log where raw_connector_request (masked request) is logged.

Please don't expose any api keys in the json or curl .

This would look something like this reqeust json for making payment :

{
    "amount":1000,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "amount_to_capture": 1000,
    "customer_id": "123sdfadf",
    "email": "[email protected]",
    "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": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            "card_number": "374245455400126",
            "card_exp_month": "05",
            "card_exp_year": "26",
            "card_holder_name": "joseph",
            "card_cvc": "1234"
        }
    },
    "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"
    }
}

raw_connector_request :

Screenshot 2024-04-04 at 4 21 19 PM

You can also any other possible test cases if there.

srujanchikke avatar Apr 04 '24 10:04 srujanchikke

curl --location 'https://sandbox.hyperswitch.io/routing/business_profile/:business_profile_id/configs/pg_agnostic_mit' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer JWT_Token' \
--data '{
    "enabled": true
}' 

the request has to be somewhat like this but exactly what route i am a bit lost , @srujanchikke assistance

vinfinity7 avatar Apr 11 '24 11:04 vinfinity7