Skip to content

Conversation

ShankarSinghC
Copy link
Contributor

@ShankarSinghC ShankarSinghC commented Dec 6, 2024

Type of Change

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

Description

Whenever a customer makes an Applepay payment a unique network token called a DPAN (Device Primary Account Number) is created and stored securely on the customer’s Apple device. This token acts as the payment information for all purchases and keeps the raw card number safe from bad actors.

However, Apple Pay’s DPAN (Device Primary Account Number) may not be ideal for all subscription businesses, because it can result in involuntary churn.

Visa is making enhancements to network tokens to ensure their continued compatibility with follow-on transactions. Due to these changes, there is impact to a few use cases for Apple Pay recurring transactions. Beginning July 30th, 2025, the current device generated Apple Pay network tokens will no longer be applicable for Standing Instruction transactions. Standing Instruction use cases constitute recurring, installments, or unscheduled credential on file token usages.

In order to add support apple pay MPAN recurring object needs to be passed to apple pay in the /sessions call.

This adds supports to accept the ApplePayRecurringPaymentRequest in the FeatureMetadata for the payment request. Based the request details passed the appropriate recurring details will be displayed in the apple pay modal during the customer authentication.

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 merchant connector account with applepay metadata to decrypt the apple pay token at hyperswitch
-> Create a payment by passing apple_pay_recurring_details

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_9ZJ9etprVKsDp4YNdgBxXsiq8bvL2ksaGVHJFTrBawKCd0ylxJb4hN8IAct6DTDa' \
--data-raw '{
    "amount": 6100,
    "currency": "USD",
    "confirm": false,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 6100,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "setup_future_usage": "off_session",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "customer_id": "1733817585",
    "feature_metadata": {
        "apple_pay_recurring_details": {
            "payment_description": "this is the apple pay recurring payment",
            "regular_billing": {
                "amount": 10,
                "label": "pay to hyperswitch'\''s merchant",
                "recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
                "recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
                "recurring_payment_interval_unit": "year",
                "recurring_payment_interval_count": 1
            },
            "billing_agreement": "billing starts from the above mentioned start date",
            "management_url": "https://applepaydemo.apple.com"
        }
    },
    "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_id": "pay_VMgqfeubSlEFDvzkl0uf",
    "merchant_id": "merchant_1733816953",
    "status": "requires_payment_method",
    "amount": 6100,
    "net_amount": 6100,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": null,
    "client_secret": "pay_VMgqfeubSlEFDvzkl0uf_secret_ewyd5zHoVQckfAXdzF9V",
    "created": "2024-12-10T07:59:03.063Z",
    "currency": "USD",
    "customer_id": "1733817543",
    "customer": {
        "id": "1733817543",
        "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": null,
    "payment_method_data": 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": null,
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "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": "US",
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "1733817543",
        "created_at": 1733817543,
        "expires": 1733821143,
        "secret": "epk_8c23ceac435c470ea279d9ea0e1659ca"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": {
        "redirect_response": null,
        "search_tags": null,
        "apple_pay_recurring_details": {
            "payment_description": "this is the apple pay recurring payment",
            "regular_billing": {
                "amount": 10,
                "label": "pay to hyperswitch's merchant",
                "recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
                "recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
                "recurring_payment_interval_unit": "year",
                "recurring_payment_interval_count": 1
            },
            "billing_agreement": "billing starts from the above mentioned start date",
            "management_url": "https://applepaydemo.apple.com"
        }
    },
    "reference_id": null,
    "payment_link": null,
    "profile_id": "pro_JcYIJy9B8xXAnFuBEdhc",
    "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": "2024-12-10T08:14:03.063Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-10T07:59:03.107Z",
    "charges": null,
    "frm_metadata": null,
    "merchant_order_reference_id": null,
    "order_tax_amount": null,
    "connector_mandate_id": null
}

-> session call

curl --location 'http://localhost:8080/payments/session_tokens' \
--header 'Content-Type: application/json' \
--header 'api-key: pk_dev_4bc816e9fc4549d6b50106976df7b29b' \
--data '{
    "payment_id": "pay_VMgqfeubSlEFDvzkl0uf",
    "wallets": [],
    "client_secret": "pay_VMgqfeubSlEFDvzkl0uf_secret_ewyd5zHoVQckfAXdzF9V"
}'
{
    "payment_id": "pay_VMgqfeubSlEFDvzkl0uf",
    "client_secret": "pay_VMgqfeubSlEFDvzkl0uf_secret_ewyd5zHoVQckfAXdzF9V",
    "session_token": [
        {
            "wallet_name": "google_pay",
            "merchant_info": {
                "merchant_name": "Stripe"
            },
            "shipping_address_required": false,
            "email_required": false,
            "shipping_address_parameters": {
                "phone_number_required": false
            },
            "allowed_payment_methods": [
                {
                    "type": "CARD",
                    "parameters": {
                        "allowed_auth_methods": [
                            "PAN_ONLY",
                            "CRYPTOGRAM_3DS"
                        ],
                        "allowed_card_networks": [
                            "AMEX",
                            "DISCOVER",
                            "INTERAC",
                            "JCB",
                            "MASTERCARD",
                            "VISA"
                        ],
                        "billing_address_required": false
                    },
                    "tokenization_specification": {
                        "type": "PAYMENT_GATEWAY",
                        "parameters": {
                            "gateway": "stripe",
                            "stripe:version": "2018-10-31",
                            "stripe:publishableKey": "pk_test_51Msk2GAGHc77EJXX78h549SX2uaOnEkUYqBfjcoD05PIpAnDkYxMn8nQ4d19im85NQuX4Z6WDyHaUw2fFTPBWsIY00Wa7oNerO"
                        }
                    }
                }
            ],
            "transaction_info": {
                "country_code": "US",
                "currency_code": "USD",
                "total_price_status": "Final",
                "total_price": "61.00"
            },
            "delayed_session_token": false,
            "connector": "cybersource",
            "sdk_next_action": {
                "next_action": "confirm"
            },
            "secrets": null
        },
        {
            "wallet_name": "samsung_pay",
            "version": "2",
            "service_id": "49400558c67f4a97b3925f",
            "order_number": "pay-VMgqfeubSlEFDvzkl0uf",
            "merchant": {
                "name": "Hyperswitch",
                "url": null,
                "country_code": "IN"
            },
            "amount": {
                "option": "FORMAT_TOTAL_PRICE_ONLY",
                "currency_code": "USD",
                "total": "61.00"
            },
            "protocol": "PROTOCOL3DS",
            "allowed_brands": [
                "visa",
                "masterCard",
                "amex",
                "discover"
            ]
        },
        {
            "wallet_name": "apple_pay",
            "session_token_data": {
                "epoch_timestamp": 1733817642366,
                "expires_at": 1733821242366,
                "merchant_session_identifier": "SSH9848925D8DD4473D8EA96E628A9F20C0_A0E617ED4A56A343E07C6E1255BD4098423B3A8E1243236462D07B14B4A0F7C3",
                "nonce": "ebdd4037",
                "merchant_identifier": "6ACD34193A900BA07E215155E3647CF4759340CF486BABAEE6C0840F9267AB10",
                "domain_name": "debuglab.basilisk-char.ts.net",
                "display_name": "Zurich Insurance (non-PROD)",
                "signature": "308006092a864886f70d010702a0803080020101310d300b0609608648016503040201308006092a864886f70d0107010000a080308203e330820388a003020102020816634c8b0e305717300a06082a8648ce3d040302307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3234303432393137343732375a170d3239303432383137343732365a305f3125302306035504030c1c6563632d736d702d62726f6b65722d7369676e5f5543342d50524f4431143012060355040b0c0b694f532053797374656d7331133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004c21577edebd6c7b2218f68dd7090a1218dc7b0bd6f2c283d846095d94af4a5411b83420ed811f3407e83331f1c54c3f7eb3220d6bad5d4eff49289893e7c0f13a38202113082020d300c0603551d130101ff04023000301f0603551d2304183016801423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b304506082b0601050507010104393037303506082b060105050730018629687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65616963613330323082011d0603551d2004820114308201103082010c06092a864886f7636405013081fe3081c306082b060105050702023081b60c81b352656c69616e6365206f6e207468697320636572746966696361746520627920616e7920706172747920617373756d657320616363657074616e6365206f6620746865207468656e206170706c696361626c65207374616e64617264207465726d7320616e6420636f6e646974696f6e73206f66207573652c20636572746966696361746520706f6c69637920616e642063657274696669636174696f6e2070726163746963652073746174656d656e74732e303606082b06010505070201162a687474703a2f2f7777772e6170706c652e636f6d2f6365727469666963617465617574686f726974792f30340603551d1f042d302b3029a027a0258623687474703a2f2f63726c2e6170706c652e636f6d2f6170706c6561696361332e63726c301d0603551d0e041604149457db6fd57481868989762f7e578507e79b5824300e0603551d0f0101ff040403020780300f06092a864886f76364061d04020500300a06082a8648ce3d0403020349003046022100c6f023cb2614bb303888a162983e1a93f1056f50fa78cdb9ba4ca241cc14e25e022100be3cd0dfd16247f6494475380e9d44c228a10890a3a1dc724b8b4cb8889818bc308202ee30820275a0030201020208496d2fbf3a98da97300a06082a8648ce3d0403023067311b301906035504030c124170706c6520526f6f74204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553301e170d3134303530363233343633305a170d3239303530363233343633305a307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b30090603550406130255533059301306072a8648ce3d020106082a8648ce3d03010703420004f017118419d76485d51a5e25810776e880a2efde7bae4de08dfc4b93e13356d5665b35ae22d097760d224e7bba08fd7617ce88cb76bb6670bec8e82984ff5445a381f73081f4304606082b06010505070101043a3038303606082b06010505073001862a687474703a2f2f6f6373702e6170706c652e636f6d2f6f63737030342d6170706c65726f6f7463616733301d0603551d0e0416041423f249c44f93e4ef27e6c4f6286c3fa2bbfd2e4b300f0603551d130101ff040530030101ff301f0603551d23041830168014bbb0dea15833889aa48a99debebdebafdacb24ab30370603551d1f0430302e302ca02aa0288626687474703a2f2f63726c2e6170706c652e636f6d2f6170706c65726f6f74636167332e63726c300e0603551d0f0101ff0404030201063010060a2a864886f7636406020e04020500300a06082a8648ce3d040302036700306402303acf7283511699b186fb35c356ca62bff417edd90f754da28ebef19c815e42b789f898f79b599f98d5410d8f9de9c2fe0230322dd54421b0a305776c5df3383b9067fd177c2c216d964fc6726982126f54f87a7d1b99cb9b0989216106990f09921d00003182018930820185020101308186307a312e302c06035504030c254170706c65204170706c69636174696f6e20496e746567726174696f6e204341202d20473331263024060355040b0c1d4170706c652043657274696669636174696f6e20417574686f7269747931133011060355040a0c0a4170706c6520496e632e310b3009060355040613025553020816634c8b0e305717300b0609608648016503040201a08193301806092a864886f70d010903310b06092a864886f70d010701301c06092a864886f70d010905310f170d3234313231303038303034325a302806092a864886f70d010934311b3019300b0609608648016503040201a10a06082a8648ce3d040302302f06092a864886f70d01090431220420ddd14d539103e445be353bf622995c58155b83740ac408582cfd95adffe59ccb300a06082a8648ce3d04030204483046022100a7071bc77f59318dc772a5e7e8a1270262a56887b019b2f449735169e2eebdf8022100c0682381a1d93da7cfa6928896cde5a58efec957855d82476531135bc359c04f000000000000",
                "operational_analytics_identifier": "Zurich Insurance (non-PROD):6ACD34193A900BA07E215155E3647CF4759340CF486BABAEE6C0840F9267AB10",
                "retries": 0,
                "psp_id": "6ACD34193A900BA07E215155E3647CF4759340CF486BABAEE6C0840F9267AB10"
            },
            "payment_request_data": {
                "country_code": "AU",
                "currency_code": "USD",
                "total": {
                    "label": "applepay",
                    "type": "final",
                    "amount": "61.00"
                },
                "merchant_capabilities": [
                    "supports3DS"
                ],
                "supported_networks": [
                    "visa",
                    "masterCard",
                    "amex",
                    "discover"
                ],
                "merchant_identifier": "merchant.sandbox.hyperswitch",
                "recurring_payment_request": {
                    "payment_description": "this is the apple pay recurring payment",
                    "regular_billing": {
                        "amount": "10",
                        "label": "pay to hyperswitch's merchant",
                        "payment_timing": "recurring",
                        "recurring_payment_start_date": "2027-09-10T10:11:12.000Z",
                        "recurring_payment_end_date": "2027-09-10T10:11:12.000Z",
                        "recurring_payment_interval_unit": "year",
                        "recurring_payment_interval_count": 1
                    },
                    "billing_agreement": "billing starts from the above mentioned start date",
                    "management_url": "https://applepaydemo.apple.com"
                }
            },
            "connector": "cybersource",
            "delayed_session_token": false,
            "sdk_next_action": {
                "next_action": "confirm"
            },
            "connector_reference_id": null,
            "connector_sdk_public_key": null,
            "connector_merchant_id": null
        }
    ]
}

-> Confirm the payment with the token

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_9ZJ9etprVKsDp4YNdgBxXsiq8bvL2ksaGVHJFTrBawKCd0ylxJb4hN8IAct6DTDa' \
--data-raw '{
    "amount": 650,
    "currency": "USD",
    "confirm": true,
    "business_country": "US",
    "business_label": "default",
    "amount_to_capture": 650,
    "customer_id": "cu_1733817737",
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "email": "[email protected]",
    "name": "Joseph Doe",
    "phone": "999999999",
    "phone_country_code": "+65",
    "description": "Its my first payment request",
    "statement_descriptor_name": "Juspay",
    "statement_descriptor_suffix": "Router",
    "payment_method": "wallet",
    "payment_method_type": "apple_pay",
    "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": {
            "apple_pay": {
                "payment_data": "CnsiZGF0YSI6IjhmMFppZDhMTGd4U1dwcE84Z3VZY25pK3RacTVTcGRJTlFOYkszZGQyMTk5ZlJGTUZrazFNUjFORkFyM1pQMjVEaEtMaHZrM1B1c05GRlRDY0hqQ1g3OXlGWTZ6WEs5T2NLYVJqVllLa3lQOUdndnpxVm1CS3pYazhMV09Ba3JBdXZ4TlVjQW1aVnZIUDZ1Mm1zWEcrQ3JFdnA0TnE0dGxwTlQ3aGFjUm5zZFd6bmlFQ0dpYWw4R3ZwM1k3aWlyeGEvL0l6RkFHSkxjdk9qOURUT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JR0ZBdEVMRVpkcHdJZ0ZKRDFUK25GRHd2QkxBSlpKMmVJN21qdnB6NzRlVlF3Q0ZhcWh1d2wrNElBQUFBQUFBQT0iLCJoZWFkZXIiOnsicHVibGljS2V5SGFzaCI6IjJDZ1k1N0xESVRVRDBxUjdEd3lIbHVUbTEyMkJ6MDlzYXMyQlVaK0VFOVU9IiwiZXBoZW1lcmFsUHVibGljS2V5IjoiTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFcVFmOTU1a0FnbmhJZzBHUmdBUU52dzBCRjBZVTRxbjdKVzdmZFY4K084Wk1mZlRWQTdwV2ZZYkwrd0M3RHl3MEFuT25INDJYWDluTS81ZWVpRjI5ZUE9PSIsInRyYW5zYWN0aW9uSWQiOiJjMWU5NGZmMjBhYjYyMTFkYzE5MWIxOTc0MDM2ZmE2NGMxNWJiNTQyYmFlMGJhMmQ4YWM4ODhiNDlhNzgwZGY5In0sInZlcnNpb24iOiJFQ192MSJ9",
                "payment_method": {
                    "display_name": "Discover 9319",
                    "network": "Discover",
                    "type": "credit"
                },
                "transaction_identifier": "c635c5b3af900d7bd81fecd7028f1262f9d030754ee65ec7afd988a678194751"
            }
        }
    }
}'
{
    "payment_id": "pay_1wv3HjvEqjxUQqEEY2RE",
    "merchant_id": "merchant_1733816953",
    "status": "succeeded",
    "amount": 650,
    "net_amount": 650,
    "shipping_cost": null,
    "amount_capturable": 0,
    "amount_received": 650,
    "connector": "cybersource",
    "client_secret": "pay_1wv3HjvEqjxUQqEEY2RE_secret_oPQa4cWsuyqIneiCfSFW",
    "created": "2024-12-10T07:49:21.254Z",
    "currency": "USD",
    "customer_id": "cu_1733816961",
    "customer": {
        "id": "cu_1733816961",
        "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": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {
            "apple_pay": {
                "last4": "9319",
                "card_network": "Discover",
                "type": "credit"
            }
        },
        "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": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "apple_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_1733816961",
        "created_at": 1733816961,
        "expires": 1733820561,
        "secret": "epk_cc4776fce33d4024a350427ee01be604"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7338169629566049304951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_1wv3HjvEqjxUQqEEY2RE_1",
    "payment_link": null,
    "profile_id": "pro_JcYIJy9B8xXAnFuBEdhc",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_pC2ENkiwqh6uOUT1d4lQ",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-12-10T08:04:21.254Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-12-10T07:49:23.458Z",
    "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

@ShankarSinghC ShankarSinghC added A-core Area: Core flows A-payment-methods Area: Payment Methods M-api-contract-changes Metadata: This PR involves API contract changes labels Dec 6, 2024
@ShankarSinghC ShankarSinghC self-assigned this Dec 6, 2024
@ShankarSinghC ShankarSinghC requested review from a team as code owners December 6, 2024 12:20
Copy link

semanticdiff-com bot commented Dec 6, 2024

@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Dec 6, 2024
@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Dec 11, 2024
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Dec 19, 2024
Merged via the queue into main with commit 6074249 Dec 19, 2024
23 of 26 checks passed
@Gnanasundari24 Gnanasundari24 deleted the apple_pay/mpan/recurring-changes branch December 19, 2024 13:32
pixincreate added a commit that referenced this pull request Dec 20, 2024
…ete-pm

* 'main' of github.com:juspay/hyperswitch:
  refactor(dynamic_routing): add col payment_method_type in dynamic_routing_stats (#6853)
  refactor(customers_v2): include minor fixes for customer v2 flows (#6876)
  fix: cypress reports generation (#6894)
  fix(connector): Paypal BankRedirects (Ideal/EPS)  (#6864)
  chore(version): 2024.12.19.1
  fix(connector): [UNIFIED_AUTHENTICATION_SERVICE] change url path to `pre_authentication_processing` in pre-auth flow (#6885)
  refactor(users): move roles schema to global interface (#6862)
  feat(payment_methods): add support to pass apple pay recurring details to obtain apple pay merchant token (#6770)
  feat(payments): [Payment links] Add config for changing button text for payment links (#6860)
  feat(core): added customer phone_number and email to session token response for click to pay (#6863)
  FEAT(klarna): Klarna Kustom Checkout Integration (#6839)
  feat(users): handle email url for users in different tenancies (#6809)
  chore(version): 2024.12.19.0
  refactor(dynamic_routing): update the authentication for update config to include JWT type (#6785)
  chore(env): remove unified_authentication_service base_url from integ, sandbox and production toml (#6865)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows A-payment-methods Area: Payment Methods M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support to pass apple pay recurring details in the payment request
4 participants