Skip to content

Conversation

ShankarSinghC
Copy link
Contributor

Type of Change

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

Description

This pr adds Samsung pay mandate support for Cybersource and enable samsung pay for cybersource on sandbox.

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?

-> Create a Cybersource connector with Samsung pay enabled for it
-> Make a samsung pay off_session payment with amount set to zero. Payment will be in failed status with "error_message": "SERVER_ERROR". This is expected, we need to get off_session payments enabled for our cybersource account.

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: api-key' \
--data-raw '{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "customer_id": "cu_1739882499",
    "setup_future_usage": "off_session",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "payment_type": "setup_mandate",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "samsung_pay",
    "customer_acceptance": {
        "acceptance_type": "offline",
        "accepted_at": "1963-05-03T04:07:52.723Z",
        "online": {
            "ip_address": "in sit",
            "user_agent": "amet irure esse"
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "California",
            "zip": "94122",
            "country": "US",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        }
    },
    "payment_method_data": {
        "wallet": {
            "samsung_pay": {
                "payment_credential": {
                    "3_d_s": {
                        "type": "S",
                        "version": "100",
                        "data": "samsung-pay-token"
                    },
                    "payment_card_brand": "VI",
                    "payment_currency_type": "USD",
                    "payment_last4_fpan": "1661",
                    "method": "3DS",
                    "recurring_payment": false
                }
            }
        }
    }
}
'
{
    "payment_id": "pay_WXbt7aYJDjO0DvyZRpsf",
    "merchant_id": "merchant_1739867293",
    "status": "failed",
    "amount": 0,
    "net_amount": 0,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "cybersource",
    "client_secret": "pay_WXbt7aYJDjO0DvyZRpsf_secret_qZUj82yqxmREZX3MBnTR",
    "created": "2025-02-18T08:29:27.643Z",
    "currency": "USD",
    "customer_id": "cu_1739867368",
    "customer": {
        "id": "cu_1739867368",
        "name": "Joseph Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+65"
    },
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": null,
    "mandate_data": null,
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "samsung_pay": {
                "last4": "1661",
                "card_network": "Visa",
                "type": 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": "California",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+91"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "next_action": null,
    "cancellation_reason": null,
    "error_code": "SERVER_ERROR",
    "error_message": "SERVER_ERROR",
    "unified_code": "UE_9000",
    "unified_message": "Something went wrong",
    "payment_experience": null,
    "payment_method_type": "samsung_pay",
    "connector_label": "cybersource_US_default_default",
    "business_country": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "cu_1739867368",
        "created_at": 1739867367,
        "expires": 1739870967,
        "secret": "epk_7c1492ae7ec84198a64f11a089f48508"
    },
    "manual_retry_allowed": true,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_lUspT7TZ8NWvqh6aWiEy",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_oGt66qf0Ct6bRlh8P9BN",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2025-02-18T08:44:27.643Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2025-02-18T08:29:28.698Z",
    "split_payments": 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

@ShankarSinghC ShankarSinghC added C-feature Category: Feature request or enhancement A-payment-methods Area: Payment Methods A-payments Area: payments labels Feb 18, 2025
@ShankarSinghC ShankarSinghC self-assigned this Feb 18, 2025
@ShankarSinghC ShankarSinghC requested a review from a team as a code owner February 18, 2025 12:45
Copy link

semanticdiff-com bot commented Feb 18, 2025

@ShankarSinghC ShankarSinghC linked an issue Feb 18, 2025 that may be closed by this pull request
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 22, 2025
Merged via the queue into main with commit 9bc8fd4 Feb 22, 2025
17 of 20 checks passed
@Gnanasundari24 Gnanasundari24 deleted the samsung-pay/fix-cybersource branch February 22, 2025 08:40
pixincreate added a commit that referenced this pull request Feb 22, 2025
…tusedPM

* 'main' of github.com:juspay/hyperswitch: (22 commits)
  feat(connector): add Samsung pay mandate support for Cybersource (#7298)
  chore(masking): add peek_mut to PeekInterface (#7281)
  feat(samsung_pay): collect customer address details form Samsung Pay based on business profile config and connector required fields (#7320)
  ci: update creds (#7345)
  feat(router): add `merchant_configuration_id` in netcetera metadata and make other merchant configurations optional (#7347)
  fix(routing): Fixed 5xx error logs in dynamic routing metrics (#7335)
  fix(connector): [DATATRANS] Fix Force Sync Flow (#7331)
  chore(version): 2025.02.21.0
  fix(connector): [DATATRANS] Add new payment status (#7327)
  feat(router): [Xendit] add support for split payments (#7143)
  fix(payment_methods_v2): update fingerprint implementation in v2 (#7270)
  feat(router): Add Payments - List endpoint for v2 (#7191)
  feat(core): add support for confirmation flow for click to pay (#6982)
  chore(version): 2025.02.20.0
  fix(connector): [SCRIPT] Update template generating script and updated connector doc (#7301)
  ci(cypress): add assertions for `requires_cvv` (#7296)
  refactor(utils): match string for state with SDK's naming convention (#7300)
  feat(core): add hypersense integration api  (#7218)
  chore(version): 2025.02.19.0
  feat(connector): [Moneris] Add payments flow (#7249)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-payment-methods Area: Payment Methods A-payments Area: payments C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add Samsung pay mandate support for Cybersource
4 participants