hyperswitch
hyperswitch copied to clipboard
refactor(connector): Use connector_request_reference_id for PayU
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
Hey @vinfinity7 , Please comment on the issue 2313, so that we can assign that issue to you.
Pls address the CI fails
Run cargo +nightly fmt
for formatting.
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 kindly review pr
@swangi-kumari if the pr's alright , you might wanna consider merging it 👍 or give me heads up as to what can i modify ?
@swangi-kumari as srujan has approved the changes , i would like to request your review too for a quick merge!
@srujanchikke whats up with this ?
@Gnanasundari24 @likhinbopanna Could you please merge this PR ?
@Gnanasundari24 @likhinbopanna Could you please merge this PR ?
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
hi @srujanchikke being new to this repo , i am not aware of the route to hit , please be clear of the curl request command
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 .
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 whereraw_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 :
You can also any other possible test cases if there.
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