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): [WorldPay] migrate from modular to standard payment APIs #6317

Merged
merged 35 commits into from
Oct 21, 2024

Conversation

kashif-m
Copy link
Contributor

@kashif-m kashif-m commented Oct 15, 2024

Type of Change

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

Description

Described in #6316

Additional Changes

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

Motivation and Context

  • Update wallet integration types
  • Sets a base for integrating DDC + 3DS and other flows for WorldPay

How did you test it?

Things to test

  1. No 3DS payment using auto capture
  2. No 3DS payment using manual capture (full amount captures)
  3. Refunds
  4. Payments Sync

Notes

  • Refunds cannot be tested as WP relies only on webhooks to update the status to settled (succeeded in HS). We do not have access to WP dashboard
  • For manually updating the status to succeeded state and testing refunds, RSA key pairs can be created and webhook updates can be sent manually by configuring the MCA during creation (attach manually created private key in merchant_secret during MCA creation)
1. Create and capture

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
    --data-raw '{"amount":100,"currency":"USD","confirm":true,"capture_method":"automatic","amount_to_capture":100,"customer_id":"default_cust","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":"debit","billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"}},"connector":["worldpay"],"payment_method_data":{"card":{"card_number":"4242424242424242","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"joseph Doe","card_cvc":"123"}},"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"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"}}'

Response

{"payment_id":"pay_uQ78SeFXTtu1gnLyPSXV","merchant_id":"merchant_1728979001","status":"processing","amount":100,"net_amount":100,"amount_capturable":0,"amount_received":null,"connector":"worldpay","client_secret":"pay_uQ78SeFXTtu1gnLyPSXV_secret_5shVMPWKUuaHIRjus5jt","created":"2024-10-17T13:44:55.458Z","currency":"USD","customer_id":"default_cust","customer":{"id":"default_cust","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"automatic","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"default_cust","created_at":1729172695,"expires":1729176295,"secret":"epk_7c0d9f2d0bc14f18a108ec71bbe3143a"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLsr1b12YDjkem6Z7PnPuvN4hnhlPExm3rw8GkY6DslOICpZY8cZeCeMgt1ol:GABqQG6u+T:u3sfHv3ezSOJxioRTixsThPEhzFW4ZZ6mObj3CK0rnFndcM0swvZMqgQwSEj5tBsydfzM4XKX20O6Nme96ha9twqxTSQIfr1rtl9V3q7fw3w5O9UZT4vQi9BMyCcaHkWSD:RbCWCcmiQqa5AX0ihMhw7pXjBe8SxvdY2KA0BLUS2HCG4Deg1bvdawSP+:est101OYSi2rNsWNZA==","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"c071b1af-b341-4544-a801-4c1baf1069c7","payment_link":null,"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_omabWO9B7CSmaCMuT6eh","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2024-10-17T13:59:55.458Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","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","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-17T13:44:56.724Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
2. Create a payment using manual capture

cURL

curl --location --request POST 'http://localhost:8080/payments' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
    --data-raw '{"amount":100,"currency":"USD","confirm":true,"capture_method":"manual","amount_to_capture":100,"customer_id":"default_cust","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":"debit","billing":{"address":{"line1":"1467","line2":"Harrison Street","line3":"Harrison Street","city":"San Fransico","state":"CA","zip":"94122","country":"US","first_name":"John","last_name":"Doe"}},"connector":["worldpay"],"payment_method_data":{"card":{"card_number":"4242424242424242","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"joseph Doe","card_cvc":"123"}},"statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"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"}}'

Response

{"payment_id":"pay_xeIPwzyWR0LgJdmy0naH","merchant_id":"merchant_1728979001","status":"requires_capture","amount":100,"net_amount":100,"amount_capturable":100,"amount_received":null,"connector":"worldpay","client_secret":"pay_xeIPwzyWR0LgJdmy0naH_secret_I08ecIDvhPtyo6VFPpMy","created":"2024-10-17T13:45:57.434Z","currency":"USD","customer_id":"default_cust","customer":{"id":"default_cust","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":{"customer_id":"default_cust","created_at":1729172757,"expires":1729176357,"secret":"epk_0e22897db0c1405db5d3e5d36bd1b941"},"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLJdvxCRiI3mwaI4JSmbC7:9KNETAbq1FDItWGved42Y0CpZY8cZeCeMgt1ol:GABqQG6u+T:u3sfHv3ezSOJxioRTixsThPEhzFW4ZZ6mObj3CK0rnFndcM0swvZMqgQwSEj5tBsydfzM4XKX20O6Nme96ha9twqxTSQIfr1rtl9V3q7fw3w5O9UZT4vQi9BMyCcaHkWSD:RbCWCcmiQqawQ7s9DbfXf9gqze1xVQbgqpPrB9mnQR6iy77NEGPEvrcVxAAczY25IvXOxdkwpszw==","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"ee3a295f-b9b4-4f1b-8bf6-d81cb7c43d31","payment_link":null,"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_omabWO9B7CSmaCMuT6eh","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2024-10-17T14:00:57.434Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","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","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-17T13:45:58.059Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}

cURL (capture)

curl --location --request POST 'http://localhost:8080/payments/pay_xeIPwzyWR0LgJdmy0naH/capture' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
    --data '{}'

Response

{"payment_id":"pay_xeIPwzyWR0LgJdmy0naH","merchant_id":"merchant_1728979001","status":"processing","amount":100,"net_amount":100,"amount_capturable":100,"amount_received":null,"connector":"worldpay","client_secret":"pay_xeIPwzyWR0LgJdmy0naH_secret_I08ecIDvhPtyo6VFPpMy","created":"2024-10-17T13:45:57.434Z","currency":"USD","customer_id":"default_cust","customer":{"id":"default_cust","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":null,"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLJdvxCRiI3mwaI4JSmbC7:9KNETAbq1FDItWGved42Y0CpZY8cZeCeMgt1ol:GABqQG6u+T:u3sfHv3ezSOJxioRTixsThPEhzFW4ZZ6mObj3CK0rnFndcM0swvZMqgQwSEj5tBsydfzM4XKX20O6Nme96ha9twqxTSQIfr1rtl9V3q7fw3w5O9UZT4vQi9BMyCcaHkWSD:RbCWCcmiQqawQ7s9DbfXf9gqze1xVQbgqpPrB9mnQR6iy77NEGPEvrcVxAAczY25IvXOxdkwpszw==","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"163c0642-9640-44e6-b200-ba3ffb249886","payment_link":null,"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_omabWO9B7CSmaCMuT6eh","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2024-10-17T14:00:57.434Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","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","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-17T13:46:49.767Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}
3. Full amount refunds

cURL

curl --location --request POST 'http://localhost:8080/refunds' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9' \
    --data '{
        "payment_id": "pay_xeIPwzyWR0LgJdmy0naH",
        "amount": 100,
        "reason": "Customer returned product",
        "refund_type": "instant",
        "metadata": {
            "udf1": "value1",
            "new_customer": "true",
            "login_date": "2019-09-10T10:11:12Z"
        }
    }'

Response

{
    "refund_id": "ref_Timrt5Zy3JKIJL57DlD1",
    "payment_id": "pay_xeIPwzyWR0LgJdmy0naH",
    "amount": 100,
    "currency": "USD",
    "status": "pending",
    "reason": "Customer returned product",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    },
    "error_message": null,
    "error_code": null,
    "created_at": "2024-10-17T14:13:27.123Z",
    "updated_at": "2024-10-17T14:13:28.120Z",
    "connector": "worldpay",
    "profile_id": "pro_OodaMoJ1Y9nlnegU4soR",
    "merchant_connector_id": "mca_omabWO9B7CSmaCMuT6eh",
    "charges": null
}
4. Retrieve payment

cURL
curl --location --request GET 'http://localhost:8080/payments/pay_xeIPwzyWR0LgJdmy0naH?force_sync=true'
--header 'Accept: application/json'
--header 'api-key: dev_sMl3D9efytjSoXznSOKCv5PHyql50M1BMhU8e7qsa5m6mXxHvyROVg7cER7AWue9'

Response

{"payment_id":"pay_xeIPwzyWR0LgJdmy0naH","merchant_id":"merchant_1728979001","status":"succeeded","amount":100,"net_amount":100,"amount_capturable":0,"amount_received":100,"connector":"worldpay","client_secret":"pay_xeIPwzyWR0LgJdmy0naH_secret_I08ecIDvhPtyo6VFPpMy","created":"2024-10-17T13:45:57.434Z","currency":"USD","customer_id":"default_cust","customer":{"id":"default_cust","name":"John Doe","email":"[email protected]","phone":"999999999","phone_country_code":"+1"},"description":"Its my first payment request","refunds":[{"refund_id":"ref_Timrt5Zy3JKIJL57DlD1","payment_id":"pay_xeIPwzyWR0LgJdmy0naH","amount":100,"currency":"USD","status":"pending","reason":"Customer returned product","metadata":{"udf1":"value1","new_customer":"true","login_date":"2019-09-10T10:11:12Z"},"error_message":null,"error_code":null,"created_at":"2024-10-17T14:13:27.123Z","updated_at":"2024-10-17T14:13:28.120Z","connector":"worldpay","profile_id":"pro_OodaMoJ1Y9nlnegU4soR","merchant_connector_id":"mca_omabWO9B7CSmaCMuT6eh","charges":null}],"disputes":null,"mandate_id":null,"mandate_data":null,"setup_future_usage":null,"off_session":null,"capture_on":null,"capture_method":"manual","payment_method":"card","payment_method_data":{"card":{"last4":"4242","card_type":null,"card_network":null,"card_issuer":null,"card_issuing_country":null,"card_isin":"424242","card_extended_bin":null,"card_exp_month":"03","card_exp_year":"2030","card_holder_name":null,"payment_checks":null,"authentication_data":null},"billing":null},"payment_token":null,"shipping":null,"billing":{"address":{"city":"San Fransico","country":"US","line1":"1467","line2":"Harrison Street","line3":"Harrison Street","zip":"94122","state":"CA","first_name":"John","last_name":"Doe"},"phone":null,"email":null},"order_details":null,"email":"[email protected]","name":"John Doe","phone":"999999999","return_url":"https://google.com/","authentication_type":"no_three_ds","statement_descriptor_name":"joseph","statement_descriptor_suffix":"JS","next_action":null,"cancellation_reason":null,"error_code":null,"error_message":null,"unified_code":null,"unified_message":null,"payment_experience":null,"payment_method_type":"debit","connector_label":null,"business_country":null,"business_label":"default","business_sub_label":null,"allowed_payment_method_types":null,"ephemeral_key":null,"manual_retry_allowed":false,"connector_transaction_id":"eyJrIjoiazNhYjYzMiIsImxpbmtWZXJzaW9uIjoiNS4wLjAifQ==.sN:g8wd64bwkbrp0md+bPxcanBnk2zLdsIqSa1pR99GGg8fCNQpPLoWNslSzWNPFBM5Tpa8tW7EFI5onKINsgChMHeJVoeH2lrBWCRyjZYT6h+lbqfJa+1BSoKFSY8HLJdvxCRiI3mwaI4JSmbC7:9KNETAbq1FDItWGved42Y0CpZY8cZeCeMgt1ol:GABqQG6u+T:u3sfHv3ezSOJxioRTixsThPEhzFW4ZZ6mObj3CK0rnFndcM0swvZMqgQwSEj5tBsydfzM4XKX20O6Nme96ha9twqxTSQIfr1rtl9V3q7fw3w5O9UZT4vQi9BMyCcaHkWSD:RbCWCcmiQqawQ7s9DbfXf9gqze1xVQbgqpPrB9mnQR6iy77NEGPEvrcVxAAczY25IvXOxdkwpszw==","frm_message":null,"metadata":{"udf1":"value1","login_date":"2019-09-10T10:11:12Z","new_customer":"true"},"connector_metadata":null,"feature_metadata":null,"reference_id":"301565b7-858f-44f4-8ee4-ec1918cbf243","payment_link":null,"profile_id":"pro_OodaMoJ1Y9nlnegU4soR","surcharge_details":null,"attempt_count":1,"merchant_decision":null,"merchant_connector_id":"mca_omabWO9B7CSmaCMuT6eh","incremental_authorization_allowed":null,"authorization_count":null,"incremental_authorizations":null,"external_authentication_details":null,"external_3ds_authentication_attempted":false,"expires_on":"2024-10-17T14:00:57.434Z","fingerprint":null,"browser_info":{"language":"nl-NL","time_zone":0,"ip_address":"127.0.0.1","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","color_depth":24,"java_enabled":true,"screen_width":1536,"accept_header":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8","screen_height":723,"java_script_enabled":true},"payment_method_id":null,"payment_method_status":null,"updated":"2024-10-17T14:13:06.975Z","charges":null,"frm_metadata":null,"merchant_order_reference_id":null,"order_tax_amount":null,"connector_mandate_id":null}

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

kashif-m and others added 23 commits September 26, 2024 16:17
@kashif-m kashif-m requested review from a team as code owners October 15, 2024 09:51
Copy link

semanticdiff-com bot commented Oct 15, 2024

Review changes with SemanticDiff.

Analyzed 7 of 12 files.

Overall, the semantic diff is 36% smaller than the GitHub diff.

Filename Status
Cargo.lock Unsupported file format
crates/router/Cargo.toml Unsupported file format
✔️ crates/router/src/consts.rs Analyzed
✔️ crates/router/src/lib.rs Analyzed
✔️ crates/router/src/connector/utils.rs Analyzed
✔️ crates/router/src/connector/worldpay.rs 37.48% smaller
✔️ crates/router/src/connector/worldpay/requests.rs 56.77% smaller
✔️ crates/router/src/connector/worldpay/response.rs 8.19% smaller
✔️ crates/router/src/connector/worldpay/transformers.rs 45.04% smaller
crates/connector_configs/toml/development.toml Unsupported file format
crates/connector_configs/toml/production.toml Unsupported file format
crates/connector_configs/toml/sandbox.toml Unsupported file format

@kashif-m kashif-m linked an issue Oct 15, 2024 that may be closed by this pull request
2 tasks
@kashif-m kashif-m removed request for a team October 17, 2024 11:28
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Oct 17, 2024
@kashif-m kashif-m self-assigned this Oct 17, 2024
Sakilmostak
Sakilmostak previously approved these changes Oct 17, 2024
@kashif-m kashif-m added the A-connector-compatibility Area: Connector compatibility label Oct 20, 2024
@@ -171,11 +171,23 @@ impl PaymentAttempt {
merchant_id: &common_utils::id_type::MerchantId,
connector_txn_id: &str,
) -> StorageResult<Self> {
let (txn_id, txn_data) = common_utils::types::ConnectorTransactionId::form_id_and_data(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc: @Narayanbhat166 can you pls review this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will be reverting this for now, can be added and discussed later.

Why?

This was added for Worldpay, and they send back transactionReference (payment_attempt_id for hyperswitch), so this query will not be invoked

Sakilmostak
Sakilmostak previously approved these changes Oct 21, 2024
Sakilmostak
Sakilmostak previously approved these changes Oct 21, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Oct 21, 2024
Merged via the queue into main with commit 58296ff Oct 21, 2024
14 of 17 checks passed
@likhinbopanna likhinbopanna deleted the worldpay-wallets-api-updates branch October 21, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-compatibility Area: Connector compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Worldpay payments integration
4 participants