Skip to content

fix(connector): update required fields for xendit #8941

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

Merged
merged 1 commit into from
Aug 13, 2025

Conversation

pixincreate
Copy link
Member

@pixincreate pixincreate commented Aug 13, 2025

Type of Change

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

Description

this pr addresses an issue where hyperswitch sdk did not return required fields resulting in transactions to not happen.

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?

Initiate Payment Link
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'api-key: dev_NCd2znDULlKeAM6hrgsfRaQe4zgRhvAQJUwpT3UgoVGJUjcjwJgZBT7BMgkEHb8I' \
--data-raw '{
    "amount": 1001200,
    "currency": "IDR",
    "confirm": false,
	"payment_link": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "customer",
    "email": "[email protected]",
    "phone": "999999999",
    "phone_country_code": "+1",
    "description": "Its my first payment request",
    "authentication_type": "no_three_ds",
    "return_url": "https://duck.com",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "metadata": {
        "udf1": "value1",
        "new_customer": "true",
        "login_date": "2019-09-10T10:11:12Z"
    }
}'
{
	"payment_id": "pay_eTNUFfS27ZBvBiTIOalZ",
	"merchant_id": "postman_merchant_GHAction_1755084978",
	"status": "requires_payment_method",
	"amount": 1001200,
	"net_amount": 1001200,
	"shipping_cost": null,
	"amount_capturable": 0,
	"amount_received": null,
	"connector": null,
	"client_secret": "pay_eTNUFfS27ZBvBiTIOalZ_secret_wzOFZMbwSWLLvc6O7rzx",
	"created": "2025-08-13T12:28:02.711Z",
	"currency": "IDR",
	"customer_id": "customer",
	"customer": {
		"id": "customer",
		"name": null,
		"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": null,
	"payment_method_data": null,
	"payment_token": null,
	"shipping": null,
	"billing": null,
	"order_details": null,
	"email": "[email protected]",
	"name": null,
	"phone": "999999999",
	"return_url": "https://duck.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": null,
	"connector_label": null,
	"business_country": null,
	"business_label": "default",
	"business_sub_label": null,
	"allowed_payment_method_types": null,
	"ephemeral_key": {
		"customer_id": "customer",
		"created_at": 1755088082,
		"expires": 1755091682,
		"secret": "epk_c63e165ddae2420e975cb21b0f9f894b"
	},
	"manual_retry_allowed": null,
	"connector_transaction_id": null,
	"frm_message": null,
	"metadata": {
		"udf1": "value1",
		"login_date": "2019-09-10T10:11:12Z",
		"new_customer": "true"
	},
	"connector_metadata": null,
	"feature_metadata": null,
	"reference_id": null,
	"payment_link": {
		"link": "http://localhost:8080/payment_link/postman_merchant_GHAction_1755084978/pay_eTNUFfS27ZBvBiTIOalZ?locale=en",
		"secure_link": "http://localhost:8080/payment_link/s/postman_merchant_GHAction_1755084978/pay_eTNUFfS27ZBvBiTIOalZ?locale=en",
		"payment_link_id": "plink_JesEx1Pk1rYTlkh2Zr8f"
	},
	"profile_id": "pro_Xq3nbFTRwHDP9JFgz2w0",
	"surcharge_details": null,
	"attempt_count": 1,
	"merchant_decision": null,
	"merchant_connector_id": null,
	"incremental_authorization_allowed": null,
	"authorization_count": null,
	"incremental_authorizations": null,
	"external_authentication_details": null,
	"external_3ds_authentication_attempted": false,
	"expires_on": "2025-08-13T12:43:02.708Z",
	"fingerprint": null,
	"browser_info": null,
	"payment_channel": null,
	"payment_method_id": null,
	"network_transaction_id": null,
	"payment_method_status": null,
	"updated": "2025-08-13T12:28:02.725Z",
	"split_payments": null,
	"frm_metadata": null,
	"extended_authorization_applied": null,
	"capture_before": null,
	"merchant_order_reference_id": null,
	"order_tax_amount": null,
	"connector_mandate_id": null,
	"card_discovery": null,
	"force_3ds_challenge": false,
	"force_3ds_challenge_trigger": false,
	"issuer_error_code": null,
	"issuer_error_message": null,
	"is_iframe_redirection_enabled": null,
	"whole_connector_response": null,
	"enable_partial_authorization": null
}
Open Payment link image image
Payment Retrieve
curl --location 'http://localhost:8080/payments/pay_eTNUFfS27ZBvBiTIOalZ?force_sync=true' \
--header 'Accept: application/json' \
--header 'api-key: dev_NCd2znDULlKeAM6hrgsfRaQe4zgRhvAQJUwpT3UgoVGJUjcjwJgZBT7BMgkEHb8I'
{
	"payment_id": "pay_eTNUFfS27ZBvBiTIOalZ",
	"merchant_id": "postman_merchant_GHAction_1755084978",
	"status": "succeeded",
	"amount": 1001200,
	"net_amount": 1001200,
	"shipping_cost": null,
	"amount_capturable": 0,
	"amount_received": 1001200,
	"connector": "xendit",
	"client_secret": "pay_eTNUFfS27ZBvBiTIOalZ_secret_wzOFZMbwSWLLvc6O7rzx",
	"created": "2025-08-13T12:28:02.711Z",
	"currency": "IDR",
	"customer_id": "customer",
	"customer": {
		"id": "customer",
		"name": null,
		"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": "1111",
			"card_type": "CREDIT",
			"card_network": "Visa",
			"card_issuer": "JP Morgan",
			"card_issuing_country": "INDIA",
			"card_isin": "411111",
			"card_extended_bin": null,
			"card_exp_month": "12",
			"card_exp_year": "2034",
			"card_holder_name": "champa lal",
			"payment_checks": null,
			"authentication_data": null
		},
		"billing": {
			"address": {
				"city": null,
				"country": null,
				"line1": null,
				"line2": null,
				"line3": null,
				"zip": null,
				"state": null,
				"first_name": "champa",
				"last_name": "lal",
				"origin_zip": null
			},
			"phone": {
				"number": "9123456789",
				"country_code": "+93"
			},
			"email": "[email protected]"
		}
	},
	"payment_token": null,
	"shipping": null,
	"billing": null,
	"order_details": null,
	"email": "[email protected]",
	"name": null,
	"phone": "999999999",
	"return_url": "https://duck.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": "credit",
	"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": "pr-1a099d71-0f2f-4dd5-979b-dcb04d577fe4",
	"frm_message": null,
	"metadata": {
		"udf1": "value1",
		"login_date": "2019-09-10T10:11:12Z",
		"new_customer": "true"
	},
	"connector_metadata": null,
	"feature_metadata": {
		"redirect_response": null,
		"search_tags": null,
		"apple_pay_recurring_details": null,
		"gateway_system": "direct"
	},
	"reference_id": "adee5a45-0856-4a35-a8b9-64f589a4f776",
	"payment_link": {
		"link": "http://localhost:8080/payment_link/postman_merchant_GHAction_1755084978/pay_eTNUFfS27ZBvBiTIOalZ?locale=en",
		"secure_link": "http://localhost:8080/payment_link/s/postman_merchant_GHAction_1755084978/pay_eTNUFfS27ZBvBiTIOalZ?locale=en",
		"payment_link_id": "plink_JesEx1Pk1rYTlkh2Zr8f"
	},
	"profile_id": "pro_Xq3nbFTRwHDP9JFgz2w0",
	"surcharge_details": null,
	"attempt_count": 1,
	"merchant_decision": null,
	"merchant_connector_id": "mca_uvxifwBKb8ywNkz1sqHV",
	"incremental_authorization_allowed": false,
	"authorization_count": null,
	"incremental_authorizations": null,
	"external_authentication_details": null,
	"external_3ds_authentication_attempted": false,
	"expires_on": "2025-08-13T12:43:02.708Z",
	"fingerprint": null,
	"browser_info": {
		"os_type": "macOS",
		"language": "en-US",
		"time_zone": -330,
		"ip_address": "127.0.0.1",
		"os_version": "10.15",
		"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:141.0) Gecko/20100101 Firefox/141.0",
		"color_depth": 24,
		"device_model": "Macintosh",
		"java_enabled": true,
		"screen_width": 1728,
		"accept_header": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
		"screen_height": 1117,
		"accept_language": "en-US,en;q=0.5",
		"java_script_enabled": true
	},
	"payment_channel": null,
	"payment_method_id": null,
	"network_transaction_id": null,
	"payment_method_status": null,
	"updated": "2025-08-13T12:32:03.344Z",
	"split_payments": null,
	"frm_metadata": null,
	"extended_authorization_applied": null,
	"capture_before": null,
	"merchant_order_reference_id": null,
	"order_tax_amount": null,
	"connector_mandate_id": null,
	"card_discovery": "manual",
	"force_3ds_challenge": false,
	"force_3ds_challenge_trigger": false,
	"issuer_error_code": null,
	"issuer_error_message": null,
	"is_iframe_redirection_enabled": null,
	"whole_connector_response": null,
	"enable_partial_authorization": null
}

Note

DO NOTE THAT, FOR XENDIT, PASSING 00 AT LSB IS MANDATORY WITHOUT WHICH PAYMENT FAILS. THIS HAPPENS TO BE AN ISSUE FROM XENDIT THEMSELVES.

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by just clippy && just clippy_v2
  • I reviewed the submitted code
  • I added unit tests for my changes where possible

@pixincreate pixincreate added this to the July 2025 Release milestone Aug 13, 2025
@pixincreate pixincreate self-assigned this Aug 13, 2025
@pixincreate pixincreate added A-connector-integration Area: Connector integration C-bug Category: Bug S-waiting-on-review Status: This PR has been implemented and needs to be reviewed A-payment-methods Area: Payment Methods labels Aug 13, 2025
Copy link

semanticdiff-com bot commented Aug 13, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/payment_methods/src/configs/payment_connector_required_fields.rs  56% smaller

@pixincreate pixincreate marked this pull request as ready for review August 13, 2025 13:08
@pixincreate pixincreate requested a review from a team as a code owner August 13, 2025 13:08
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Aug 13, 2025
Merged via the queue into main with commit dc2357a Aug 13, 2025
25 of 29 checks passed
@Gnanasundari24 Gnanasundari24 deleted the connector/xendit-required-field-fix branch August 13, 2025 15:17
@pixincreate pixincreate removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Aug 13, 2025
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 A-payment-methods Area: Payment Methods C-bug Category: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants