アリペイ

Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer’s login credentials.

特徴 #

顧客ロケーション中国の消費者
華僑
中国人旅行者
通貨の処理CNY, GBP, USD, EUR, HKD
決済通貨GBP,HKD,EUR
最低取引額0.01 CNY
最大取引額No limit
払い戻し
一部払い戻し
複数回の一部払い戻し
チャージバック

禁止業種 Both WooshPay and Alipay Plus maintain a list of prohibited businesses that aren’t allowed to use their services. To use Alipay Plus on WooshPay, your business can’t be restricted from using or appear on Alipay’s prohibited business list. If you’re not sure if your business is a prohibited business, or have questions about how these requirements apply to you, please contact support@wooshpay.com.

Subproducts #

ProductPayment scenarios description
Web PaymentOn Desktop browser, after selecting Alipay as a payment method merchant checkout, a QR code appears. The shopper then opens Alipay app on their mobile phone and scans the barcode displayed on the browser page to complete the payment.
APP PaymentOn the mobile browser, a shopper selects Alipay as a payment method on Merchant checkout, and as redirected from the browser into the Alipay app to complete the payment before being redirected back to the Merchant browser.

支払いの流れ #

Web Payment #

pic_1.png

APP Payment #

pic_2.png

統合方式 #

支払い方法の列挙値: アリペイ

There are two integration methods for Alipay

  1. ダイレクトAPI
  2. チェックアウト
Integration methodpayment scenariosterminal_type enumeration values
ダイレクトAPIWeb PaymentWEB
ダイレクトAPIAPP paymentAPP
チェックアウトWeb PaymentYou don’t need to identify the terminal_type in checkout. Checkout will automatically generate a QR code or redirect to Alipay app based on their device.
チェックアウトAPP paymentYou don’t need to identify the terminal_type in checkout. Checkout will automatically generate a QR code or redirect to Alipay app based on their device.

ダイレクトAPI #

A PaymentIntent is an object that represents your intent to collect payment from your customer and tracks the lifecycle of the payment process. Create a PaymentIntent on your server and specify the amount to collect and a supported currency.

PaymentIntentの作成 #

For direct API integration, you can create PaymentIntent and get url in only one step. The following is the demo of creating payment intents:

  • Web Payment
  • APP payment

You can control the payment scenarios generated in Payment Intent by changing the enumeration values of the terminal type:payemen_method_options.alipay.terminal_type

Web Payment #

リクエスト

{
    "amount": 20,
    "currency": "CNY",
    "confirm": true,
    "payment_method_options": {
        "alipay": {
            "client_ip": "192.168.0.1",
            "terminal_type": "WEB",
            "os_type": "IOS"
        }
    },
    "payment_method_data": {
        "type": "alipay"
    },
    "payment_method_types": [
        "alipay"
    ],
    "return_url": "https://wooshpay.com"
}

応答

{
    "id": "pi_1666729870215872512",
    "object": "payment_intent",
    "created": 1686214342000,
    "currency": "CNY",
    "amount": 20,
    "status": "requires_action",
    "livemode": true,
    "client_secret": "pi_1666729870215872512_secret_jmGL6NBNInPx5zdjIJ2utli4",
    "next_action": {
        "type": "redirect_to_url",
        "alipay_handle_redirect": {
            "url": "https://open-sea.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=28166604009zSv0130nTr0bKfhzSwT08YvSW"
        }
    },
    "payment_method_types": [
        "alipay"
    ],
    "confirmation_method": "automatic",
    "payment_method_options": {
        "alipay": {
            "terminal_type": "WEB",
            "os_type": "IOS",
            "client_ip": "192.168.0.1"
        }
    },
    "return_url": "https://wooshpay.com",
    "payment_method": "pm_1666729870102626304",
    "capture_method": "automatic"
}

について url from next_action can be opened, from the link, the customer will be redirect to Alipay’s checkout page. The customner can scan the QR code or login to the wallet to pay.

APP payment #

リクエスト

{
    "amount": 20,
    "currency": "CNY",
    "confirm": true,
    "payment_method_options": {
        "alipay": {
            "client_ip": "192.168.0.1",
            "terminal_type": "APP",
            "os_type": "IOS"
        }
    },
    "payment_method_data": {
        "type": "alipay"
    },
    "payment_method_types": [
        "alipay"
    ],
    "return_url": "https://wooshpay.com"
}

応答

{
    "id": "pi_1666732544285999104",
    "object": "payment_intent",
    "created": 1686214980000,
    "currency": "CNY",
    "amount": 20,
    "status": "requires_action",
    "livemode": true,
    "client_secret": "pi_1666732544285999104_secret_NRUV59FL6qtFyz2bXVeDyLD4",
    "next_action": {
        "type": "redirect_to_url",
        "alipay_handle_redirect": {
            "url": "https://render.alipay.com/p/s/i/?scheme=alipays%3A%2F%2Fplatformapi%2FstartApp%3FappId%3D10000007%26actionType%3Droute%26qrcode%3D281666040092tD6e6GlEzzTlQl6HrEqv3kOI%26externalThrough%3D%257B%2522acTerminalType%2522%253A%2522WAP%2522%257D"
        }
    },
    "payment_method_types": [
        "alipay"
    ],
    "confirmation_method": "automatic",
    "payment_method_options": {
        "alipay": {
            "terminal_type": "APP",
            "os_type": "IOS",
            "client_ip": "192.168.0.1"
        }
    },
    "return_url": "https://wooshpay.com",
    "payment_method": "pm_1666732544155975680",
    "capture_method": "automatic"
}

チェックアウト #

To support Alipay payments, a Checkout Session must satisfy all of the following conditions:

  • Prices for all line items must be in the same currency. If you have line items in different currencies, create separate Checkout Sessions for each currency.
  • 使用できるのは1回限りの項目のみです。

Enable Alipay as a payment method

新しいチェックアウト・セッションを作成する際には、以下のことが必要です:

アリペイプラスをリストに加える payment_method_types(支払い方法タイプ. Make sure all 行目 同じ通貨を使う。

セッションの作成 #

You don’t need to identify the terminal_type when you create a checkout session. Checkout will automatically generate a QR code or redirect to Alipay App based on their device.

リクエスト

{
    "cancel_url": "www.baidu.com",
    "mode": "payment",
    "success_url": "https://wooshpay.com/",
    "payment_method_types": [
        "alipay"
    ],
    "line_items": [
        {
            "price_data": {
                "currency": "CNY",
                "unit_amount": 100000,
                "active": true,
                "product_data": {
                    "name": "taiwan fengli"
                },
                "billing_scheme": "testscheme",
                "lookup_key": "test_lookup_key"
            },
            "quantity": 1
        }
    ]
}

応答

{
    "id": "cs_1666733999608823808",
    "object": "checkout.session",
    "created": 1686215327000,
    "currency": "CNY",
    "customer": "",
    "mode": "payment",
    "livemode": true,
    "status": "open",
    "url": "https://checkout.wooshpay.com/pay/cs_1666733999608823808?key=pk_live_dGVzdDpKeEQzUXhpWDJyYkFRZEo1QWtWN0dHUFo=",
    "cancel_url": "www.baidu.com",
    "line_items": {
        "object": "list",
        "data": [
            {
                "id": "li_1666733999642378240",
                "object": "item",
                "currency": "CNY",
                "description": "taiwan fengli",
                "price": {
                    "id": "price_1666733999659155456",
                    "object": "price",
                    "created": 1686215327000,
                    "active": true,
                    "currency": "CNY",
                    "product": {
                        "id": "prod_1666733999675932672",
                        "object": "product",
                        "created": 1686215327000,
                        "active": true,
                        "name": "taiwan fengli",
                        "livemode": true,
                        "updated": 1686215327000
                    },
                    "type": "one_time",
                    "livemode": true,
                    "unit_amount": 100000,
                    "billing_scheme": "per_unit",
                    "lookup_key": "test_lookup_key"
                },
                "quantity": 1,
                "amount_subtotal": 100000,
                "amount_total": 100000
            }
        ]
    },
    "payment_intent": "pi_1666733999864676352",
    "payment_method_types": [
        "alipay"
    ],
    "payment_status": "unpaid",
    "success_url": "https://wooshpay.com/",
    "amount_subtotal": 100000,
    "amount_total": 100000,
    "billing_address_collection": "auto",
    "expires_at": 1686301726587,
    "payment_link": "",
    "client_secret": "pi_1666733999864676352_secret_5S1FMaseZU6gfIZjl2QlOdY7"
}

について url from next_action can be opened, from the link, the customer will be redirect to Alipay’s checkout page. The customner can scan the QR code or login to the wallet to pay.

次のステップ #

必要に応じて、統合にさらに機能を追加することができます。

ウェブフックの作成 #

統合が自動的にリアクションをトリガーできるように、WooshPayアカウントのイベントをリッスンします。enabled_eventsとurlにフォーカスしたWebhookを作成します。

払い戻しの作成 #

顧客に資金を返済するために返金を作成します。部分払い戻しを行うこともできますが、すべての支払い方法が対応しているわけではありません。部分払い戻しとは、元の取引金額の一部のみを払い戻すことです。

What are your feelings
Updated on 8月 8, 2023