Skip to content

Conversation

AkshayaFoiger
Copy link
Contributor

@AkshayaFoiger AkshayaFoiger commented Jun 12, 2024

Type of Change

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

Description

This PR

  1. Implements Ideal through Iatapay
  2. Introduces - Fps, PromptPay, DuitNow, LocalBankRedirect and VietQr payment methods through Iatapay

Additional Changes

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

How did you test it?

Note: Test it through stripe compatibility layer

  1. Create duit_now payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_TNf0H146I1a9LKcLowvwHtQLh1g72JJcDNdrg6wYcLeHV6KIKeWyp1zdrHbGo0zN' \
--data-raw '{
  "amount": 5000,
  "currency": "MYR",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "real_time_payment",
  "payment_method_type": "duit_now",
  "payment_method_data": {
    "real_time_payment": {
      "duit_now": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "MY",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "MY",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

{
    "payment_id": "pay_JfXNiJgjo00qq4ORuxf2",
    "merchant_id": "merchant_1718197054",
    "status": "requires_customer_action",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 5000,
    "amount_received": null,
    "connector": "iatapay",
    "client_secret": "pay_JfXNiJgjo00qq4ORuxf2_secret_fiBGz7RjaEGSyqDKU2gv",
    "created": "2024-06-12T13:32:35.532Z",
    "currency": "MYR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "real_time_payment",
    "payment_method_data": {
        "real_time_payment": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "MY",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "MY",
            "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": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_JfXNiJgjo00qq4ORuxf2/merchant_1718197054/pay_JfXNiJgjo00qq4ORuxf2_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "duit_now",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1718199155,
        "expires": 1718202755,
        "secret": "epk_7972ee408a524738a0806ad0f8377421"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "PCL2H7Z9I1RMJ",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_JfXNiJgjo00qq4ORuxf2_1",
    "payment_link": null,
    "profile_id": "pro_EcQFJD8m3tzLcmGwaKer",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_DQ1iFyhnHGdaYGiUzeNh",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T13:47:35.532Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T13:32:37.203Z",
    "charges": null,
    "frm_metadata": null
}
  1. Create a fps payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_Y3mOgiOo3VydfP4VUuloc4aOiJcfbjWUnoucA8MkIKgRymssmbqpYJ8ki9xtdTkL' \
--data-raw '{
  "amount": 5000,
  "currency": "HKD",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "real_time_payment",
  "payment_method_type": "fps",
  "payment_method_data": {
    "real_time_payment": {
      "fps": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "HK",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "HK",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

{
    "payment_id": "pay_1VOzag66T87c7GCv9ynV",
    "merchant_id": "merchant_1718199711",
    "status": "requires_customer_action",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 5000,
    "amount_received": null,
    "connector": "iatapay",
    "client_secret": "pay_1VOzag66T87c7GCv9ynV_secret_kJHWGRBELlTouNC1Qasz",
    "created": "2024-06-12T13:42:18.326Z",
    "currency": "HKD",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "real_time_payment",
    "payment_method_data": {
        "real_time_payment": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "HK",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "HK",
            "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": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_1VOzag66T87c7GCv9ynV/merchant_1718199711/pay_1VOzag66T87c7GCv9ynV_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "fps",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1718199738,
        "expires": 1718203338,
        "secret": "epk_7ea3635b1c3a4d3780eb020212502a45"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "PEDRYTZD9NKFN",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_1VOzag66T87c7GCv9ynV_1",
    "payment_link": null,
    "profile_id": "pro_Rfq8skJz9NVxDSNGXKEP",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_cfYq8J8DhOJOdNhJiyZm",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T13:57:18.326Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T13:42:19.932Z",
    "charges": null,
    "frm_metadata": null
}
  1. Create a Ideal Payment
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_MLoE5hwElFeS5bv6FFF4SsMKq8p9dl7gIizOIH44yuKIUrzrCbo3HGEj1JcDOgle' \
--data-raw '{
  "amount": 5000,
  "currency": "EUR",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "bank_redirect",
  "payment_method_type": "ideal",
  "payment_method_data": {
    "bank_redirect": {
      "ideal": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "NL",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "NL",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

{
    "payment_id": "pay_TfUWOdNFJaIp7ha6HBWt",
    "merchant_id": "merchant_1718199849",
    "status": "requires_customer_action",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 5000,
    "amount_received": null,
    "connector": "iatapay",
    "client_secret": "pay_TfUWOdNFJaIp7ha6HBWt_secret_sMGLcHl8V7UjKucVsWEb",
    "created": "2024-06-12T13:44:24.689Z",
    "currency": "EUR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "NL",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "NL",
            "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": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_TfUWOdNFJaIp7ha6HBWt/merchant_1718199849/pay_TfUWOdNFJaIp7ha6HBWt_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "ideal",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1718199864,
        "expires": 1718203464,
        "secret": "epk_0d35e5a6a90745cd956999f8d0c1630d"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "PZ7JGDSDAZRGU",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_TfUWOdNFJaIp7ha6HBWt_1",
    "payment_link": null,
    "profile_id": "pro_UMHwyMBI0VUbwmeD39Mw",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_T9v7kw1z0a64rZqX3Dwq",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T13:59:24.689Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T13:44:26.111Z",
    "charges": null,
    "frm_metadata": null
}
  1. Create a payment with prompt_pay
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_LSel3TXzIK0iBKQhBYtJXzy1AiayF8lv0c4WPVTMrz7gNN8tZ2vq9O3u0hHHFWMh' \
--data-raw '{
  "amount": 5000,
  "currency": "THB",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "real_time_payment",
  "payment_method_type": "prompt_pay",
  "payment_method_data": {
    "real_time_payment": {
      "prompt_pay": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "TH",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "TH",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

{
    "payment_id": "pay_CBRgxOzd0bHNfZ0e51gc",
    "merchant_id": "merchant_1718200249",
    "status": "requires_customer_action",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 5000,
    "amount_received": null,
    "connector": "iatapay",
    "client_secret": "pay_CBRgxOzd0bHNfZ0e51gc_secret_TV6A2yewPMC3ceS0xwy8",
    "created": "2024-06-12T13:51:11.800Z",
    "currency": "THB",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "real_time_payment",
    "payment_method_data": {
        "real_time_payment": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "TH",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "TH",
            "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": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_CBRgxOzd0bHNfZ0e51gc/merchant_1718200249/pay_CBRgxOzd0bHNfZ0e51gc_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "prompt_pay",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1718200271,
        "expires": 1718203871,
        "secret": "epk_4a96fbd53f004349885706f9e62f4fc3"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "PES5XBW5MYKKY",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_CBRgxOzd0bHNfZ0e51gc_1",
    "payment_link": null,
    "profile_id": "pro_ExR0Z1hPIdaRHyKieIGF",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_e8qeqRMEyiG8wUARIS4f",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T14:06:11.800Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T13:51:13.748Z",
    "charges": null,
    "frm_metadata": null
}
  1. Create a payment with VietQR
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ao4PjtWz0O6xDjBILbqDFvKtC9qC8oDDtwenCzPLf2zbc04u0FFoeIwtkwhODNxX' \
--data-raw '{
  "amount": 5000,
  "currency": "VND",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "real_time_payment",
  "payment_method_type": "viet_qr",
  "payment_method_data": {
    "real_time_payment": {
      "viet_qr": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "VN",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "TH",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_ao4PjtWz0O6xDjBILbqDFvKtC9qC8oDDtwenCzPLf2zbc04u0FFoeIwtkwhODNxX' \
--data-raw '{
  "amount": 5000,
  "currency": "VND",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "real_time_payment",
  "payment_method_type": "viet_qr",
  "payment_method_data": {
    "real_time_payment": {
      "viet_qr": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "VN",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "TH",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'
  1. Create a local bank redirect
curl --location 'http://localhost:8080/payments' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'api-key: dev_UrPGuj9JjMd02f402w2Msqlo16i1wR6KWRZabeWM6BWXD1DMk6imr8P5VFBAPH6d' \
--data-raw '{
  "amount": 5000,
  "currency": "EUR",
  "confirm": true,
  "capture_method": "automatic",
  "capture_on": "2022-09-10T10:11:12Z",
  "amount_to_capture": 5000,
  "customer_id": "IatapayCustomer",
  "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": "bank_redirect",
  "payment_method_type": "local_bank_redirect",
  "payment_method_data": {
    "bank_redirect": {
      "local_bank_redirect": {}
    }
  },
  "billing": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "NL",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "shipping": {
    "address": {
      "line1": "1467",
      "line2": "Harrison Street",
      "line3": "Harrison Street",
      "city": "San Fransico",
      "state": "California",
      "zip": "94122",
      "country": "TH",
      "first_name": "joseph",
      "last_name": "Doe"
    },
    "phone": {
      "number": "8056594427",
      "country_code": "+91"
    }
  },
  "statement_descriptor_name": "joseph",
  "statement_descriptor_suffix": "JS",
  "metadata": {
    "udf1": "value1",
    "new_customer": "true",
    "login_date": "2019-09-10T10:11:12Z"
  }
}'

Response

{
    "payment_id": "pay_bxQ8D1Q536166I4YPlZS",
    "merchant_id": "merchant_1718200928",
    "status": "requires_customer_action",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 5000,
    "amount_received": null,
    "connector": "iatapay",
    "client_secret": "pay_bxQ8D1Q536166I4YPlZS_secret_hh6gQ5of1Fhf5OM1VI1j",
    "created": "2024-06-12T14:04:18.743Z",
    "currency": "EUR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "TH",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "NL",
            "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": "John Doe",
    "phone": "999999999",
    "return_url": "https://google.com/",
    "authentication_type": "no_three_ds",
    "statement_descriptor_name": "joseph",
    "statement_descriptor_suffix": "JS",
    "next_action": {
        "type": "redirect_to_url",
        "redirect_to_url": "http://localhost:8080/payments/redirect/pay_bxQ8D1Q536166I4YPlZS/merchant_1718200928/pay_bxQ8D1Q536166I4YPlZS_1"
    },
    "cancellation_reason": null,
    "error_code": null,
    "error_message": null,
    "unified_code": null,
    "unified_message": null,
    "payment_experience": null,
    "payment_method_type": "local_bank_redirect",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": {
        "customer_id": "IatapayCustomer",
        "created_at": 1718201058,
        "expires": 1718204658,
        "secret": "epk_3c7d850def764132bf183e058ebb5a6b"
    },
    "manual_retry_allowed": null,
    "connector_transaction_id": "PFVRZV06LPW74",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_bxQ8D1Q536166I4YPlZS_1",
    "payment_link": null,
    "profile_id": "pro_0jzKD0X6iztyc18Yo4ZT",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_A6sRIIVXY5YyT7PLy4hg",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T14:19:18.743Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T14:04:20.475Z",
    "charges": null,
    "frm_metadata": null
}

on psync Response

{
    "payment_id": "pay_bxQ8D1Q536166I4YPlZS",
    "merchant_id": "merchant_1718200928",
    "status": "succeeded",
    "amount": 5000,
    "net_amount": 5000,
    "amount_capturable": 0,
    "amount_received": 5000,
    "connector": "iatapay",
    "client_secret": "pay_bxQ8D1Q536166I4YPlZS_secret_hh6gQ5of1Fhf5OM1VI1j",
    "created": "2024-06-12T14:04:18.743Z",
    "currency": "EUR",
    "customer_id": "IatapayCustomer",
    "customer": {
        "id": "IatapayCustomer",
        "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": "bank_redirect",
    "payment_method_data": {
        "bank_redirect": {},
        "billing": null
    },
    "payment_token": null,
    "shipping": {
        "address": {
            "city": "San Fransico",
            "country": "TH",
            "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
    },
    "billing": {
        "address": {
            "city": "San Fransico",
            "country": "NL",
            "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": "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": "local_bank_redirect",
    "connector_label": null,
    "business_country": null,
    "business_label": "default",
    "business_sub_label": null,
    "allowed_payment_method_types": null,
    "ephemeral_key": null,
    "manual_retry_allowed": false,
    "connector_transaction_id": "PFVRZV06LPW74",
    "frm_message": null,
    "metadata": {
        "udf1": "value1",
        "login_date": "2019-09-10T10:11:12Z",
        "new_customer": "true"
    },
    "connector_metadata": null,
    "feature_metadata": null,
    "reference_id": "pay_bxQ8D1Q536166I4YPlZS_1",
    "payment_link": null,
    "profile_id": "pro_0jzKD0X6iztyc18Yo4ZT",
    "surcharge_details": null,
    "attempt_count": 1,
    "merchant_decision": null,
    "merchant_connector_id": "mca_A6sRIIVXY5YyT7PLy4hg",
    "incremental_authorization_allowed": null,
    "authorization_count": null,
    "incremental_authorizations": null,
    "external_authentication_details": null,
    "external_3ds_authentication_attempted": false,
    "expires_on": "2024-06-12T14:19:18.743Z",
    "fingerprint": null,
    "browser_info": null,
    "payment_method_id": null,
    "payment_method_status": null,
    "updated": "2024-06-12T14:05:01.945Z",
    "charges": null,
    "frm_metadata": 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

@AkshayaFoiger AkshayaFoiger requested review from a team as code owners June 12, 2024 11:47
@AkshayaFoiger AkshayaFoiger self-assigned this Jun 12, 2024
@AkshayaFoiger AkshayaFoiger added A-connector-compatibility Area: Connector compatibility A-connector-integration Area: Connector integration M-api-contract-changes Metadata: This PR involves API contract changes labels Jun 12, 2024
@hyperswitch-bot hyperswitch-bot bot removed the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement Ideal ,Fps, PromptPay, DuitNow and VietQr router(connectors):[Iatapay] implement Ideal , Fps, PromptPay, DuitNow and VietQr Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement Ideal , Fps, PromptPay, DuitNow and VietQr router(connectors):[Iatapay] implement real time processing payment method and Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement real time processing payment method and Ideal router(connectors):[Iatapay] implement real time processing payment method sand Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement real time processing payment method sand Ideal router(connectors):[Iatapay] implement real time processing payment method and Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement real time processing payment method and Ideal router(connectors):[Iatapay] implement real_time_payment payment method and Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors):[Iatapay] implement real_time_payment payment method and Ideal router(connectors): [Iatapay] implement real_time_payment payment method and Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title router(connectors): [Iatapay] implement real_time_payment payment method and Ideal feat(connectors): [Iatapay] implement real_time_payment payment method and Ideal Jun 12, 2024
Fps {
/// The two-letter ISO country code for SEPA and BACS
#[schema(value_type = CountryAlpha2, example = "US")]
country: Option<api_enums::CountryAlpha2>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not required as we are already collecting payment_method_data.billing details

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed country from all real time payment methods.

@hyperswitch-bot hyperswitch-bot bot added the M-api-contract-changes Metadata: This PR involves API contract changes label Jun 12, 2024
Chethan-rao
Chethan-rao previously approved these changes Jun 12, 2024
Copy link
Contributor

@Chethan-rao Chethan-rao left a comment

Choose a reason for hiding this comment

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

Routing related changes LGTM

sahkal
sahkal previously approved these changes Jun 12, 2024
api_models::enums::PaymentMethod::RealTimePayment => {
if let Some(payment_method_types) = methods.payment_method_types {
for method_type in payment_method_types {
reward_details.push(Provider {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be real_time_payment_details right?

@AkshayaFoiger AkshayaFoiger dismissed stale reviews from sahkal and Chethan-rao via f339179 June 12, 2024 14:30
Chethan-rao
Chethan-rao previously approved these changes Jun 12, 2024
@sahkal sahkal self-requested a review June 12, 2024 14:56
sahkal
sahkal previously approved these changes Jun 12, 2024
SamraatBansal
SamraatBansal previously approved these changes Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title feat(connectors): [Iatapay] implement real_time_payment payment method and Ideal feat(connectors): [Iatapay] implement real_time_payments and Ideal Jun 12, 2024
@AkshayaFoiger AkshayaFoiger changed the title feat(connectors): [Iatapay] implement real_time_payments and Ideal feat(connectors): [Iatapay] add payment methods Jun 12, 2024
@likhinbopanna likhinbopanna added this pull request to the merge queue Jun 13, 2024
Merged via the queue into main with commit 0e059e7 Jun 13, 2024
@likhinbopanna likhinbopanna deleted the iatapay/add-payment-methods branch June 13, 2024 04:00
pixincreate added a commit that referenced this pull request Jun 13, 2024
…outs

* 'main' of github.com:juspay/hyperswitch:
  feat(router): include the pre-routing connectors in Apple Pay retries (#4952)
  fix(cypress): Add `jwt_token` and `cookie` for routing test (#4953)
  feat(connectors): [Iatapay] add payment methods (#4968)
  chore(version): 2024.06.13.0
  feat(payouts): make payout_type optional in payouts table (#4954)
  feat(connector): [BOA/CYB] Make billTo fields optional (#4951)
  fix(core): fix the multitenancy prefix  in routing cache (#4963)
  refactor(connector): [Mifinity]Move destination_account_number from pmd to Mifinity Metadata (#4962)
  refactor(payment_methods): Enable deletion of default Payment Methods (#4942)
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 M-api-contract-changes Metadata: This PR involves API contract changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants