メインコンテンツへスキップ
このページで

月払い(利息付き)は、お客様が購入金額を複数の月額支払い回数に分割し、残高に対して利息を適用する支払いオプションです。

MCI(Monthly Installment with Interest)では、お客様は購入金額を月額支払い回数に分割する際に、追加の利息を支払うことになります。

お客様が「月払い(利息付き)」を選択した場合、購入金額は月額支払い回数と利息で分割され、各期間の残高に対して利息が適用されます。

MCIの仕組み#

MCIのフローは以下のとおりです。

  1. 店舗は、DEUNA AdminでPSP(Payment Service Provider)を通じて、さまざまな月額支払いオプションを設定します。
  2. 以下の要素が考慮されます。
    • 適用されるクレジットカードのフランチャイズ。
    • 設定された各支払い回数の最低金額。
    • 各フランチャイズに適用される利息。
  3. ストアのチェックアウトでは、顧客がカードのBINを入力すると、MCIの利用状況が表示されます。
  4. お客様は、チェックアウト画面に表示されるリストから月額支払いを選択します。
  5. トランザクションは、処理のためにPSPに送信されます。

MCIの実装#

MSIまたはMCIを使用するには、少なくとも1つの分割払いキャンペーンを設定してください。

分割払いオプションを提供するには:

  1. キャンペーンオプションを生成 installments_type.
curl --location --request POST 'https://apigw.getduna.com/merchants/{merchant_id}/installments/campaigns' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
    "name": "new campaign",
    "description": "testing campaign MCI",
    "status": "active",
    "processors": [
        {
            "id": {processor_id},
            "name": {processor_name}
        }
    ],
		// display_label_template is optional; that configuration allows you to 
		// change the format of the field "display_label_amount" of each available 
    	'// option when you generate an installment plan. If you don`t configurate this'
    	'// field, the template will be the default one.'
    "display_label_template": {
        "language": "es",
        "MSI": "{installments} meses sin intereses de ${amount}",
        "MCI": "{installments} meses de ${amount}"
    },
    "options": [
        {
            "installments": 3,
            "installments_type": "MCI",
            "currency": "MXN",
            "card_branch": [
                {
										// minimum amount for installment amount in the plan, this option
										// will be valid to generate installment plan only in that case;
										// For example, with a total amount of $2100; in 3 installments the amount 
										// will be of $700, so $700 >= $500, then the option is valid to
										// generate an installment plan of $2100 (you can offer 3 installments
										// to pay $2100). In the case of having intallments_rate greater than 0, 
										// first the interest is applied to the amount and then it is compared with the min_amount.
                    "amount_min": 500,
										// optional, the same example than amount_min but with the maximum value.
                    "amount_max": 2000,
                    "name": "visa",
										// is the percentage applied to the amount in order to generate the options for the plan.
										"installment_rate": 1.5,
										// use the operators "amount", "rate" and "installments" when calculate the new amount;
										// if it's not specified, the calculation is the default for interests: "amount+(amount*(rate/100))"
										"installments_interest_formula": "amount+((amount*rate*installments)/100)"
                }
            ]
        },
        {
            "installments": 6,
            "installments_type": "MCI",
            "currency": "MXN",
            "card_branch": [
                {
                    "amount_min": 250,
                    "amount_max": 1000,
                    "name": "visa",
                }
            ]
        }
				// you can offer more options, the installments quantity must be divisible by 3.
    ]
}'
  1. お使いのストアの決済プロセッサが取引を実行できるように、以下の設定を有効にします。 allow_installments: true設定の動作は以下のとおりです。
    • "MCI" or null: プロセッサに送信される金額には利息は適用されません。プロセッサによって利息が適用された後に取引を更新する必要があります。プロセッサからの応答に基づいて更新されるフィールドは以下のとおりです。
      • amount
      • installments_amount
      • installments_rate
    • "MSI": 利息なしのトランザクションは、トランザクションを実行するプロセッサに送信されます。金額はプロセッサに計算された利息とともに到達します。金額はトランザクションの実行前に更新され、プロセッサに送信されます。

プロセッサの作成例

curl --location --request POST 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
    "name": {processor_name},
    "payment_processor_id": {processor_id},
    "enabled": true,
    "currency_iso3": "MXN",
    "external_merchant_id": "your merchant id in payment processor",
    "public_api_key": "your public key in payment processor",
		"private_api_key": "your private key in payment processor",
    "allow_installments": true,
		"mci_to_psp_as": "MCI"|"MSI"
}'

プロセッサの更新例

curl --location --request PATCH 'https://apigw.getduna.com/merchants/{merchant_id}/stores/{store_code}/processors/{merchant_payment_processor_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {merchant_auth_token}' \
--data '{
    "allow_installments": true,
		"mci_to_psp_as": "MCI"|"MSI"
}'
  1. Подтвердите, может ли магазин использовать предустановленные варианты оплаты, предоставляемые VTEX.
    • Если это поддерживается, варианты оплаты, полученные от VTEX, должны соответствовать настройкам кампании и уже включать соответствующие проценты.
    • В противном случае DEUNA создает план оплаты MCI на основе конфигурации кампании. Сумма зависит от:
      • installments_rate: 金額に直接適用されます。 3DS の結果を伝送する必要がない場合 installments_interest_formula が定義されています。
      • installments_interest_formula: 指定されている場合、金利の計算は以下のに基づいて行われます。
        • amount
        • rate
        • installments
  1. VTEXで有効になっている分割払いに合わせて、DEUNAのエンドポイントを設定します。
    1. MCI専用のエンドポイントを作成し、それがMCI用であることを指定します。
    2. エンドポイントを設定しない場合、デフォルトのエンドポイントが使用されます。
curl --location 'https://apigw.getduna.com/merchants/{merchant_id}/external-endpoints' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {merchant_auth_token}' \
  --data '{
      "url": "https://middleware.deuna.io/api/v1/merchants/{merchant_id}/transactions/{transaction_id}/installments/mci?bin={bin}&salesChannel=1&paymentProcessors=t1pagos",
      "http_method": "GET",
      "headers": [
          {
              "key": "vtex-key-header",
              "value": "vtex-value-header"
          }
      ],
      "config_type": "MCI"
  }'
  1. 分割払いオプションを問い合わせます。
curl --location --request GET 'https://apigw.getduna.com/merchants/transactions/orders/{orden_token}/installments?bin={card_bin}'
	--header 'x-api-key: {x_api_key}'
	--header 'Authorization: Bearer {merchant_auth_token}'
  1. 分割払いオプションを選択します。
  2. 分割払いオプションを使用して購入を行います。
curl --location --request POST 'https://api.sandbox.deuna.io/v2/merchants/orders/purchase' \
--header 'x-api-key: {x_api_key}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {user_auth_token}' \
--data-raw '{
    "order_token": "{order_token}",
    "payer_info": {
        "email": "test123@testuser.com"
    },
    "payment_source": {
        "method_type": "credit_card",
        "processor": "{processor_name}",
        "card_info": {
            "expiry_month": "11",
            "expiry_year": "2028",
            "card_holder": "DEUNA Developers",
            "card_holder_dni": "185396924",
            "card_number": "4111111111111111",
            "card_cvv": "123",
            "address1": "Vergara 548",
            "zip": "001100",
            "city": "Santiago",
            "state": "RM",
            "country": "CL",
            "phone": "12345755",
            "installment": {
                "plan_option_id": "{plan_option_id}"
            }
        }
    }
}'

MCIのテスト#

キャンペーンを作成するには、以下の手順が必要です。

  • 商社として認証を取得してください。
  • 分割払いを提供するプロセッサを設定してください。
  • これらのプロセッサは、DEUNAエコシステムに関連するIDと名前を持つ必要があります。

例

JavaScript
{
	"processors": [
		{
			"id": 39,
			"name": "mercadopago"
		}
	]
}

同じキャンペーンは、以下のオプションで設定する必要があります。 "installments_type": "MCI".

例

JavaScript
{
	"options": [
        	{
            	"installments": 3,
            	"installments_type": "MCI",
            	"currency": "MXN",
            	"card_branch": [
                	...
            	]
        	}
	]
}

以下のいずれかの card_branchで、 "name" を設定できます:

  • visa
  • mastercard
  • amex

期待されるレスポンスコード

  • 201: 成功したキャンペーンの作成
  • 401: キャンペーンの作成には認証されていません。
  • 400: 無効なリクエスト。

商用決済プロセッサを作成するには、以下の手順が必要です:

  1. 商社として認証
  2. VTEXでの分割払い処理に必要な認証情報が必要です。

VTEXとの連携

Подтвердите доступность MCI для требуемого магазина VTEX с вашим менеджером DEUNA перед тестированием получения вариантов оплаты.

Менеджер подтвердит допустимый магазин, кампанию, подключения к процессорам и то, является ли предоставленный VTEX вариант оплаты или расчет DEUNA авторитетным.

VTEXで特定の認証情報を持つエンドポイントを設定するために必要な追加設定が必要な場合は、外部エンドポイントを作成する必要があります。

期待されるレスポンスコード

  • 200: 外部エンドポイントの正常な作成。
  • 401: 外部エンドポイントの作成には認証されていません。
  • 400: 無効なリクエスト。

分割払いプランの照会

注文を作成した後、カードの BIN を使用して分割払いプランをクエリします。

期待されるレスポンスコード

  • 200: 分割払いプランの正常な取得。
  • 401: 商用決済プロセッサの作成には認証されていません。
  • 400: 無効なリクエスト。
  • 404: 商用決済プロセッサが正しく設定されていません。

テストカード

プロセッサからすべてのテストカード情報を提供してください。

一般的に、データは次のとおりです。

  • "card_number"
  • "card_cvv"
  • "expiry_year"
  • "expiry_month"
  • "card_holder"

期待されるレスポンスコード

  • 200: 成功した決済
  • 401: ユーザーが購入を行う権限がありません。
  • 400: 無効なリクエスト、例えば、商人が決済プロセッサを有効にしていない場合。
  • 422: トランザクションの実行に失敗しました。処理が拒否されました。