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

feat(router): [BOA] implement mandates for cards and wallets #4232

Merged
merged 16 commits into from
Apr 2, 2024

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Mar 27, 2024

Type of Change

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

Description

Implement zero auth and non-zero auth mandates for card and wallet (Googlepay and Applepay)

Test Cases

  1. Card threeDs and no threeDs mandate payment in Bank of America
    a. Create a customer initiated transaction
    three_ds_type = no_three_ds and three_ds
    capture_method = automatic and manual
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{}}' \
--data-raw '{
    
    
    "amount": 1404,
    "currency": "USD",
    "confirm": true,
    "capture_method": "{{capture_method}}",
    "capture_on": "2022-09-10T10:11:12Z",
    
    "customer_id": "CustomerX",
    "email": "[email protected]",
    "authentication_type": "{{three_ds_type}}",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            
            "card_number": "4111111111111111",
            
            
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "card_cvc": "029"
        }
    },
    "billing": {
        "address": {
            "line1": "cq",
            "city": "dshcvjhdw",
            "state": "whecvjkcdv",
            "zip": "46205",
            "country": "MW",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        }
    },
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590043"
    },
    "business_label": "food",
    "business_country": "US",
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD"
            }
        }
    },
    "setup_future_usage": "off_session"
}'

Response

{
    "payment_id": "pay_780HcHAxkY7TwXAP1Iap",
    "merchant_id": "merchant_1711534931",
    "status": "succeeded",
    "amount": 1404,
    "net_amount": 1404,
    "amount_capturable": 0,
    "amount_received": 1404,
    "connector": "bankofamerica",
    "client_secret": "pay_780HcHAxkY7TwXAP1Iap_secret_Z8iCH65RKqajxdZKqv2z",
    "created": "2024-03-27T10:25:09.088Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_h94B6K9fUmUuEzQTvDVk",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12.000Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD",
                "start_date": null,
                "end_date": null,
                "metadata": null
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": "41111111",
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_TIPkgrp6QuupIn5Sos0U",
    "shipping": null,
    "billing": {
        "address": {
            "city": "dshcvjhdw",
            "country": "MW",
            "line1": "cq",
            "line2": null,
            "line3": null,
            "zip": "46205",
            "state": "whecvjkcdv",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "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": "bankofamerica_US_food",
    "business_country": "US",
    "business_label": "food",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1711535109,
        "expires": 1711538709,
        "secret": "epk_22b63421e7b64b42a69239d1eba88558"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7115351119116878404953",
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590043"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_780HcHAxkY7TwXAP1Iap_1",
    "payment_link": null,
    "profile_id": "pro_i1Wo0aXT2i3N9PFvlykZ",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_yo3dWvdwsZXGwKrq1GIu",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-27T10:40:09.088Z",
    "fingerprint": null,
    "payment_method_id": "pm_IAV14SWKo46wce9XHwCU",
    "payment_method_status": null
}

b. Create a merchant initiated transaction

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{}}' \
--data '{
  "amount": 700,
  "currency": "USD",
  "off_session": true,
  "confirm": true,
  "capture_method": "automatic",
  "description": "Initiated by merchant",
  "mandate_id": "man_h94B6K9fUmUuEzQTvDVk",
  "customer_id": "CustomerX",
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  }
}'

Response
{
"payment_id": "pay_780HcHAxkY7TwXAP1Iap",
"merchant_id": "merchant_1711534931",
"status": "succeeded",
"amount": 700,
"net_amount": 700,
"amount_capturable": 0,
"amount_received": 700,
"connector": "bankofamerica",
"client_secret": "pay_6pzAF0lBIhs3QaTxDNYC_secret_k1PSnHM3Zi7Mr9nr5Pth",
"created": "2024-03-27T10:46:17.199Z",
"currency": "USD",
"customer_id": "CustomerX",
"description": "Initiated by merchant",
"refunds": null,
"disputes": null,
"mandate_id": "man_Tbk17RquWB6pVvYqOh9r",
"mandate_data": null,
"setup_future_usage": null,
"off_session": null,
"capture_on": null,
"capture_method": "automatic",
"payment_method": "wallet",
"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": "John",
"last_name": "Doe"
},
"phone": null,
"email": null
},
"order_details": null,
"email": "[email protected]",
"name": "John Doe",
"phone": "999999999",
"return_url": null,
"authentication_type": "no_three_ds",
"statement_descriptor_name": null,
"statement_descriptor_suffix": null,
"next_action": null,
"cancellation_reason": null,
"error_code": null,
"error_message": null,
"unified_code": null,
"unified_message": null,
"payment_experience": null,
"payment_method_type": "google_pay",
"connector_label": null,
"business_country": null,
"business_label": "default",
"business_sub_label": null,
"allowed_payment_method_types": null,
"ephemeral_key": {
"customer_id": "CustomerX",
"created_at": 1711536377,
"expires": 1711539977,
"secret": "epk_dc15cccfe220420db145d6a5b7c685ed"
},
"manual_retry_allowed": false,
"connector_transaction_id": "7115351119116878404954",
"frm_message": null,
"metadata": null,
"connector_metadata": null,
"feature_metadata": null,
"reference_id": "pay_6pzAF0lBIhs3QaTxDNYC_1",
"payment_link": null,
"profile_id": "pro_i1Wo0aXT2i3N9PFvlykZ",
"surcharge_details": null,
"attempt_count": 1,
"merchant_decision": null,
"merchant_connector_id": "mca_yo3dWvdwsZXGwKrq1GIu",
"incremental_authorization_allowed": null,
"authorization_count": null,
"incremental_authorizations": null,
"external_authentication_details": null,
"external_3ds_authentication_attempted": false,
"expires_on": "2024-03-27T11:01:17.199Z",
"fingerprint": null,
"payment_method_id": null,
"payment_method_status": null
}
2. Google mandate payment in Bank Of America
a. Create a customer initiated transaction

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_QTbcRqV8CsM1jUTMdQZXP4edFfiiUhNHP5q9cgNBy78UoSqIk6wjZwQVLfSumFYg' \
--data-raw '{
    "amount": 1900,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "CustomerX",
    "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": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "Visa •••• 1111",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                },
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": ""
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "Dubai",
            "zip": "94122",
            "country": "AE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1", 
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "setup_future_usage": "off_session"
    
    
}'

Response

{
    "payment_id": "pay_fxBSKYrWZjmSirc5h4Wb",
    "merchant_id": "merchant_1711534931",
    "status": "succeeded",
    "amount": 1900,
    "net_amount": 1900,
    "amount_capturable": 0,
    "amount_received": 1900,
    "connector": "bankofamerica",
    "client_secret": "pay_fxBSKYrWZjmSirc5h4Wb_secret_dCp1tSkh6iMVzYelTSOy",
    "created": "2024-03-27T10:45:54.234Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_Tbk17RquWB6pVvYqOh9r",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00.000Z",
                "end_date": "2023-05-21T00:00:00.000Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AE",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "Dubai",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        },
        "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": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1711536354,
        "expires": 1711539954,
        "secret": "epk_9181aff1ef0846518b00855d16f0ef77"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7115363548056631004951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_fxBSKYrWZjmSirc5h4Wb_1",
    "payment_link": null,
    "profile_id": "pro_i1Wo0aXT2i3N9PFvlykZ",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_yo3dWvdwsZXGwKrq1GIu",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-27T11:00:54.234Z",
    "fingerprint": null,
    "payment_method_id": "pm_Sdue7b2Hh15rvd78bNAq",
    "payment_method_status": null
}

b. Create a merchant initiated transaction

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{}}' \
--data '{
  "amount": 700,
  "currency": "USD",
  "off_session": true,
  "confirm": true,
  "capture_method": "automatic",
  "description": "Initiated by merchant",
  "mandate_id": "man_Tbk17RquWB6pVvYqOh9r",
  "customer_id": "CustomerX",
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  }
}'

Response

{
    "payment_id": "pay_6pzAF0lBIhs3QaTxDNYC",
    "merchant_id": "merchant_1711534931",
    "status": "succeeded",
    "amount": 700,
    "net_amount": 700,
    "amount_capturable": 0,
    "amount_received": 700,
    "connector": "bankofamerica",
    "client_secret": "pay_6pzAF0lBIhs3QaTxDNYC_secret_k1PSnHM3Zi7Mr9nr5Pth",
    "created": "2024-03-27T10:46:17.199Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": "Initiated by merchant",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_Tbk17RquWB6pVvYqOh9r",
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "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": "John",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1711536377,
        "expires": 1711539977,
        "secret": "epk_dc15cccfe220420db145d6a5b7c685ed"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7115363777496638904951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_6pzAF0lBIhs3QaTxDNYC_1",
    "payment_link": null,
    "profile_id": "pro_i1Wo0aXT2i3N9PFvlykZ",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_yo3dWvdwsZXGwKrq1GIu",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-27T11:01:17.199Z",
    "fingerprint": null,
    "payment_method_id": null,
    "payment_method_status": null
}
  1. Create setup intent payment card payments through Bank Of America and do a merchant initiated transaction
    a. Setup Intent
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{}}' \
--data-raw '{
    
    
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    
    "customer_id": "CustomerX",
    "email": "[email protected]",
    "authentication_type": "no_three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            
            "card_number": "4111111111111111",
            
            
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "card_cvc": "029"
        }
    },
    "billing": {
        "address": {
            "line1": "cq",
            "city": "dshcvjhdw",
            "state": "whecvjkcdv",
            "zip": "46205",
            "country": "MW",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        }
    },
    "payment_type": "setup_mandate",
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD"
            }
        }
    },
    "setup_future_usage": "off_session"
}'

Response

{
    "payment_id": "pay_9IBw7g44TSErLs1MI9iG",
    "merchant_id": "merchant_1711600126",
    "status": "succeeded",
    "amount": 0,
    "net_amount": 0,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "bankofamerica",
    "client_secret": "pay_9IBw7g44TSErLs1MI9iG_secret_FcOcCSSevS72TB8KP6oN",
    "created": "2024-03-28T04:46:10.777Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": null,
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_RF31TSWIMxqSVwGI9Pbc",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "online",
            "accepted_at": "2022-09-10T10:11:12.000Z",
            "online": {
                "ip_address": "123.32.25.123",
                "user_agent": "Mozilla/5.0 (Linux; Android 12; SM-S906N Build/QP1A.190711.020; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/80.0.3987.119 Mobile Safari/537.36"
            }
        },
        "mandate_type": {
            "single_use": {
                "amount": 6540,
                "currency": "USD",
                "start_date": null,
                "end_date": null,
                "metadata": null
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": "41111111",
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_KZ12h6e8P6sXBFka5Vqe",
    "shipping": null,
    "billing": {
        "address": {
            "city": "dshcvjhdw",
            "country": "MW",
            "line1": "cq",
            "line2": null,
            "line3": null,
            "zip": "46205",
            "state": "whecvjkcdv",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": null,
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "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": {
        "customer_id": "CustomerX",
        "created_at": 1711601170,
        "expires": 1711604770,
        "secret": "epk_352f8c2b89924838b955909c3326245e"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7116011711726107504951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_9IBw7g44TSErLs1MI9iG_1",
    "payment_link": null,
    "profile_id": "pro_iDZ9Wume0GZJG8XSkNMs",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_mQ6QUKWnBmG7cpFkFnI3",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-28T05:01:10.777Z",
    "fingerprint": null,
    "payment_method_id": "pm_0YdwQsLbmlZFQKMzxTBn",
    "payment_method_status": null
}

b. MIT

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_3PdOyaXsRTqE5eCRRMwGiRk7Mh1nuFAt0ryhH0elyZE6RjVCQ2UcRiMHXf74hbNr' \
--data '{
  "amount": 700,
  "currency": "USD",
  "off_session": true,
  "confirm": true,
  "capture_method": "automatic",
  "description": "Initiated by merchant",
  "mandate_id": "man_RF31TSWIMxqSVwGI9Pbc",
  "customer_id": "CustomerX",
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  }
}'

Response

{
    "payment_id": "pay_9o6PVs7rjY5LJEHTEdzl",
    "merchant_id": "merchant_1711600126",
    "status": "succeeded",
    "amount": 700,
    "net_amount": 700,
    "amount_capturable": 0,
    "amount_received": 700,
    "connector": "bankofamerica",
    "client_secret": "pay_9o6PVs7rjY5LJEHTEdzl_secret_rfsyUPR6tGd9FjTvK7Xa",
    "created": "2024-03-28T04:46:31.684Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": "Initiated by merchant",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_RF31TSWIMxqSVwGI9Pbc",
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "card",
    "payment_method_data": null,
    "payment_token": "a8d7071e-d0c1-423c-8a4f-04a06db61d48",
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "US",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "California",
            "first_name": "John",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": null,
    "phone": null,
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "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": {
        "customer_id": "CustomerX",
        "created_at": 1711601191,
        "expires": 1711604791,
        "secret": "epk_74269f7f5d9c4b5583b44e3d6ca4a527"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7116011919936126704951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_9o6PVs7rjY5LJEHTEdzl_1",
    "payment_link": null,
    "profile_id": "pro_iDZ9Wume0GZJG8XSkNMs",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_mQ6QUKWnBmG7cpFkFnI3",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-28T05:01:31.684Z",
    "fingerprint": null,
    "payment_method_id": null,
    "payment_method_status": null
}

4.Setup mandate with Bank of America googlepay
a.Create a setup mandate

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{}}' \
--data-raw '{
    "amount": 0,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "CustomerX",
    "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": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "Visa •••• 1111",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                },
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": ""
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "Dubai",
            "zip": "94122",
            "country": "AE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "payment_type": "setup_mandate",
    "mandate_data": {
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00Z",
                "end_date": "2023-05-21T00:00:00Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "setup_future_usage": "off_session"
}'

Response

{
    "payment_id": "pay_3rLp1gqFDkms1pHQAYBs",
    "merchant_id": "merchant_1711600126",
    "status": "succeeded",
    "amount": 0,
    "net_amount": 0,
    "amount_capturable": 0,
    "amount_received": null,
    "connector": "bankofamerica",
    "client_secret": "pay_3rLp1gqFDkms1pHQAYBs_secret_KLMV81RzYabuZgYAb40O",
    "created": "2024-03-28T04:51:35.888Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": "Its my first payment request",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_X5CDTiWn8lbYsP9dRepE",
    "mandate_data": {
        "update_mandate_id": null,
        "customer_acceptance": {
            "acceptance_type": "offline",
            "accepted_at": "1963-05-03T04:07:52.723Z",
            "online": {
                "ip_address": "125.0.0.1",
                "user_agent": "amet irure esse"
            }
        },
        "mandate_type": {
            "multi_use": {
                "amount": 1000,
                "currency": "USD",
                "start_date": "2023-04-21T00:00:00.000Z",
                "end_date": "2023-05-21T00:00:00.000Z",
                "metadata": {
                    "frequency": "13"
                }
            }
        }
    },
    "setup_future_usage": "off_session",
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AE",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "Dubai",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        },
        "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": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1711601495,
        "expires": 1711605095,
        "secret": "epk_caa93c2640f54045aadca8ff6fe07aeb"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7116015002866316604951",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_3rLp1gqFDkms1pHQAYBs_1",
    "payment_link": null,
    "profile_id": "pro_iDZ9Wume0GZJG8XSkNMs",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_mQ6QUKWnBmG7cpFkFnI3",
    "incremental_authorization_allowed": false,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-28T05:06:35.888Z",
    "fingerprint": null,
    "payment_method_id": "pm_SCVRvuxuCYh3NX9yTEQ5",
    "payment_method_status": null
}

b. Create a MIT

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key:{{}}' \
--data '{
  "amount": 700,
  "currency": "USD",
  "off_session": true,
  "confirm": true,
  "capture_method": "automatic",
  "description": "Initiated by merchant",
  "mandate_id": "man_X5CDTiWn8lbYsP9dRepE",
  "customer_id": "CustomerX",
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "US",
      "first_name": "John",
      "last_name": "Doe"
    }
  }
}'

Response

{
    "payment_id": "pay_HJeRrm2pon3ZCRsuG9pZ",
    "merchant_id": "merchant_1711600126",
    "status": "succeeded",
    "amount": 700,
    "net_amount": 700,
    "amount_capturable": 0,
    "amount_received": 700,
    "connector": "bankofamerica",
    "client_secret": "pay_HJeRrm2pon3ZCRsuG9pZ_secret_KuWhnqasQiQdXKcl2y8n",
    "created": "2024-03-28T04:51:54.027Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "description": "Initiated by merchant",
    "refunds": null,
    "disputes": null,
    "mandate_id": "man_X5CDTiWn8lbYsP9dRepE",
    "mandate_data": null,
    "setup_future_usage": null,
    "off_session": null,
    "capture_on": null,
    "capture_method": "automatic",
    "payment_method": "wallet",
    "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": "John",
            "last_name": "Doe"
        },
        "phone": null,
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": null,
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": null,
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1711601514,
        "expires": 1711605114,
        "secret": "epk_a9e0125d21134aa69d1fdddeaa6f0443"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7116015143826286504953",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_HJeRrm2pon3ZCRsuG9pZ_1",
    "payment_link": null,
    "profile_id": "pro_iDZ9Wume0GZJG8XSkNMs",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_mQ6QUKWnBmG7cpFkFnI3",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-03-28T05:06:54.027Z",
    "fingerprint": null,
    "payment_method_id": null,
    "payment_method_status": null
}
  1. Applepay mandate payment, Bank of America
  2. Setup mandate flow for Applepay, Bank Of America.
  3. Create a Card payment
    capture_method = automatic and manual
    three_ds_type = no_three_ds and three_ds
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: {{}}' \
--data-raw '{
    
    
    "amount": 1404,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    
    "customer_id": "CustomerX",
    "email": "[email protected]",
    "authentication_type": "three_ds",
    "return_url": "https://google.com",
    "payment_method": "card",
    "payment_method_type": "credit",
    "payment_method_data": {
        "card": {
            
            "card_number":  "4111111111111111",
            
            
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "card_cvc": "029"
        }
    },
    "billing": {
        "address": {
            "line1": "cq",
            "city": "dshcvjhdw",
            "state": "whecvjkcdv",
            "zip": "46205",
            "country": "MW",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        }
    },
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590043"
    },
    "business_label": "food",
    "business_country": "US", 
    "setup_future_usage": "off_session"
}'

Response

{
    "payment_id": "pay_2QQkH4Du0OXtGnY5wKp8",
    "merchant_id": "merchant_1712049171",
    "status": "requires_customer_action",
    "amount": 1404,
    "net_amount": 1404,
    "amount_capturable": 1404,
    "amount_received": null,
    "connector": "bankofamerica",
    "client_secret": "pay_2QQkH4Du0OXtGnY5wKp8_secret_1ZQ0bo0EuDExjG0kxTZv",
    "created": "2024-04-02T12:11:09.427Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "customer": {
        "id": "CustomerX",
        "name": "John Doe",
        "email": "[email protected]",
        "phone": "999999999",
        "phone_country_code": "+1"
    },
    "description": null,
    "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": "card",
    "payment_method_data": {
        "card": {
            "last4": "1111",
            "card_type": null,
            "card_network": null,
            "card_issuer": null,
            "card_issuing_country": null,
            "card_isin": "411111",
            "card_extended_bin": "41111111",
            "card_exp_month": "12",
            "card_exp_year": "30",
            "card_holder_name": "joseph Doe",
            "payment_checks": null,
            "authentication_data": null
        },
        "billing": null
    },
    "payment_token": "token_NHp2sUl5sIn4uxtHOEWU",
    "shipping": null,
    "billing": {
        "address": {
            "city": "dshcvjhdw",
            "country": "MW",
            "line1": "cq",
            "line2": null,
            "line3": null,
            "zip": "46205",
            "state": "whecvjkcdv",
            "first_name": "joseph",
            "last_name": "doe"
        },
        "phone": {
            "number": "12345",
            "country_code": "+93"
        },
        "email": null
    },
    "order_details": null,
    "email": "[email protected]",
    "name": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "three_ds",
    "statement_descriptor_name": null,
    "statement_descriptor_suffix": null,
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_2QQkH4Du0OXtGnY5wKp8/merchant_1712049171/pay_2QQkH4Du0OXtGnY5wKp8_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "credit",
    "connector_label": "bankofamerica_US_food",
    "business_country": "US",
    "business_label": "food",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1712059869,
        "expires": 1712063469,
        "secret": "epk_9b018b64c6a34a938ed78bc7429d77b3"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": null,
    "frm_message": null,
    "metadata": {
        "count_tickets": 1,
        "transaction_number": "5590043"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_2QQkH4Du0OXtGnY5wKp8_1",
    "payment_link": null,
    "profile_id": "pro_8k3uFeCtyIMCKF92QipK",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HnQ7nFZPeKGbXmZDXLYB",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-04-02T12:26:09.427Z",
    "fingerprint": null,
    "payment_method_id": null,
    "payment_method_status": null
}
  1. Create a Googlepay payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_OQP1AwWFWDjQVaUkbv4E4KvghAs8bf9g89qsJwSEzefankTXh0e3GHxE16GB81p8' \
--data-raw '{
    "amount": 100,
    "currency": "USD",
    "confirm": true,
    "capture_method": "automatic",
    "capture_on": "2022-09-10T10:11:12Z",
    "customer_id": "CustomerX",
    "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": "wallet",
    "payment_method_type": "google_pay",
    "payment_method_data": {
        "wallet": {
            "google_pay": {
                "type": "CARD",
                "description": "Visa •••• 1111",
                "info": {
                    "card_network": "VISA",
                    "card_details": "1111"
                },
                "tokenization_data": {
                    "type": "PAYMENT_GATEWAY",
                    "token": ""
                }
            }
        }
    },
    "billing": {
        "address": {
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "city": "San Fransico",
            "state": "Dubai",
            "zip": "94122",
            "country": "AE",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        }
    },
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS" 
}'

Response

{
    "payment_id": "pay_U5yJ4BGdhuv2LLDkY7gV",
    "merchant_id": "merchant_1712049171",
    "status": "succeeded",
    "amount": 100,
    "net_amount": 100,
    "amount_capturable": 0,
    "amount_received": 100,
    "connector": "bankofamerica",
    "client_secret": "pay_U5yJ4BGdhuv2LLDkY7gV_secret_5YaYW3otOlKMXo2V1ZWU",
    "created": "2024-04-02T12:15:32.608Z",
    "currency": "USD",
    "customer_id": "CustomerX",
    "customer": {
        "id": "CustomerX",
        "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": "wallet",
    "payment_method_data": {
        "wallet": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": null,
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "AE",
            "line1": "1467",
            "line2": "Harrison Street",
            "line3": "Harrison Street",
            "zip": "94122",
            "state": "Dubai",
            "first_name": "joseph",
            "last_name": "Doe"
        },
        "phone": {
            "number": "8056594427",
            "country_code": "+97"
        },
        "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": "google_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "CustomerX",
        "created_at": 1712060132,
        "expires": 1712063732,
        "secret": "epk_d0912c4068144a579b2a5b7f29269bdc"
    },
    "manual_retry_allowed": false,
    "connector_transaction_id": "7120601330476514004953",
    "frm_message": null,
    "metadata": null,
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_U5yJ4BGdhuv2LLDkY7gV_1",
    "payment_link": null,
    "profile_id": "pro_8k3uFeCtyIMCKF92QipK",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_HnQ7nFZPeKGbXmZDXLYB",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-04-02T12:30:32.608Z",
    "fingerprint": null,
    "payment_method_id": null,
    "payment_method_status": null
}
  1. Create an Applepay payment
    Note: Mandates Mit, must be tested with the new payment_method_id flow. Additionally, Mandates 3ds is not working for Cybersource and with this PR for BOA too. An issue regarding this is raised.

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

@AkshayaFoiger AkshayaFoiger added A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement labels Mar 27, 2024
@AkshayaFoiger AkshayaFoiger self-assigned this Mar 27, 2024
@AkshayaFoiger AkshayaFoiger requested a review from a team as a code owner March 27, 2024 11:34
@AkshayaFoiger AkshayaFoiger changed the title feat(connectors): [BOA] implement mandates for card and wallet feat(router): [BOA] implement mandates for card and wallet Mar 28, 2024
@AkshayaFoiger AkshayaFoiger changed the title feat(router): [BOA] implement mandates for card and wallet feat(router): [BOA] implement mandates for cards and wallets Mar 28, 2024
@AkshayaFoiger AkshayaFoiger requested a review from a team as a code owner March 28, 2024 11:07
action_list,
action_token_types,
authorization_options,
commerce_indicator: String::from("internet"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Consult @deepanshu-iiitu on hard-coding of commerce_indicator for BoA production sanity.

Copy link
Contributor

Choose a reason for hiding this comment

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

For apple pay payments, the commerce indicator needs to be specific to the card network.

@SamraatBansal
Copy link
Contributor

In line 1570 of transformers.rs you need to handle authorised status in case of amount = 0 to chagred

Comment on lines 545 to 548
incremental_authorization_allowed: Some(
mandate_status == enums::AttemptStatus::Authorized,
),
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Incremental Authorization is not implemented for BOA. Please put this value as none.

Comment on lines 825 to 831
let is_setup_mandate_payment = item.router_data.request.is_setup_mandate_payment();

let capture = Some(
!((is_setup_mandate_payment && is_capture_automatic)
|| (!is_setup_mandate_payment && !is_capture_automatic)),
);

Copy link
Contributor

Choose a reason for hiding this comment

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

Check this logic and maybe try to keep this logic at connector level on the basis of amount.

deepanshu-iiitu
deepanshu-iiitu previously approved these changes Apr 1, 2024
SamraatBansal
SamraatBansal previously approved these changes Apr 1, 2024
crates/router/src/connector/bankofamerica/transformers.rs Outdated Show resolved Hide resolved
deepanshu-iiitu
deepanshu-iiitu previously approved these changes Apr 1, 2024
Copy link
Contributor

@ArjunKarthik ArjunKarthik left a comment

Choose a reason for hiding this comment

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

@AkshayaFoiger Avoid duplicating code and try to reuse the code by having from, try_from impl

commerce_indicator,
consumer_authentication_information,
) = match item.request.payment_method_data.clone() {
api::PaymentMethodData::Card(ccard) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Break the impl for cards and wallets into smaller from & try_from. Keep the code modular and readable

Comment on lines 1169 to 1225
let email = item.router_data.request.get_email()?;
let bill_to =
build_bill_to(item.router_data.get_billing()?, email)?;
let order_information =
OrderInformationWithBill::from((item, bill_to));
let processing_information =
ProcessingInformation::try_from((
item,
Some(PaymentSolution::ApplePay),
Some(apple_pay_data.payment_method.network.clone()),
))?;
let client_reference_information =
ClientReferenceInformation::from(item);
let payment_information = PaymentInformation::ApplePayToken(
ApplePayTokenPaymentInformation {
fluid_data: FluidData {
value: Secret::from(apple_pay_data.payment_data),
},
tokenized_card: ApplePayTokenizedCard {
transaction_type: TransactionType::ApplePay,
},
},
);
let merchant_defined_information =
item.router_data.request.metadata.clone().map(|metadata| {
Vec::<MerchantDefinedInformation>::foreign_from(
metadata.peek().to_owned(),
)
});
let ucaf_collection_indicator = match apple_pay_data
.payment_method
.network
.to_lowercase()
.as_str()
{
"mastercard" => Some("2".to_string()),
_ => None,
};
Ok(Self {
processing_information,
payment_information,
order_information,
merchant_defined_information,
client_reference_information,
consumer_authentication_information: Some(
BankOfAmericaConsumerAuthInformation {
ucaf_collection_indicator,
cavv: None,
ucaf_authentication_data: None,
xid: None,
directory_server_transaction_id: None,
specification_version: None,
},
),
})
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, move this to from or try_from impl

Comment on lines 552 to 567
let error_reason = error_response
.error_information
.message
.to_owned()
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string());
let error_message = error_response.error_information.reason.to_owned();
let response = Err(types::ErrorResponse {
code: error_message
.clone()
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
message: error_message.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
reason: Some(error_reason),
status_code: item.http_code,
attempt_status: None,
connector_transaction_id: Some(error_response.id.clone()),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

We are rewriting this logic in multiple places, why can't we handle it in a from impl here and wherever BankOfAmericaErrorInformation -> ErrorResponse?

deepanshu-iiitu
deepanshu-iiitu previously approved these changes Apr 2, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Apr 2, 2024
Merged via the queue into main with commit 2f304e6 Apr 2, 2024
12 of 15 checks passed
@likhinbopanna likhinbopanna deleted the bankOfAmerica/3ds branch April 2, 2024 14:27
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 A-connector-integration Area: Connector integration C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants