決済方法の登録・変更をするAPIです。
支払方法・支払タイミング・プランを一挙に登録・更新します。
| メソッド | URI | Headers |
|---|---|---|
/api/payment/method |
Default |
| パラメーター名 | 型 | 内容 | 特記 |
|---|---|---|---|
| payment_method | tinyint | 1:クレジット 5:コンビニ払い | |
| plan | int | プラン人数 | 2021.09.08段階最低5人以上 |
| payment_timing | tinyint | 1:年払い 5:月払い | |
| credit_card_type | tinyint | カード種類 | クレジットカードのブランド 1 : VISA 2 : MASTER 3 : JCB 4 : AMEX 5 : DINERS |
| credit_card_number | string | カード番号 | GMO JSのgetTokenメソッドにて取得した、間に*でマスク入っているカード番号 |
{
'payment_method' : 1,
'plan' : 10,
'payment_timing' : 5,
'credit_card_number' : '41111********111',
}
※ クレジットカード情報はクレジットカード登録モーダルで登録済みなので、支払方法にてクレジットカードを選択しているが、実際クレジットカードを決済APIに登録しているか確認するため、マスクしたクレジットカード番号をリクエストパラメータに含めています。
成功時
| パラメーター名 | 型 | 内容 | 特記 |
|---|---|---|---|
| result | boolean | リクエスト結果 | |
| is_initial | boolean | 初回の支払設定登録か? true:初回 false:初回以外 |
初回の支払設定登録の場合は、当月支払画面へリダイレクトします。 |
{
"result" : true,
"data" : {
"is_initial" : true
},
}
ステータスコード:200
| パラメーター名 | 型 | 内容 | 特記 |
|---|---|---|---|
| result | boolean | リクエスト結果 | |
| payment_method | string | not null / int | |
| plan | string | not null / int / 5人以上 | |
| payment_timing | string | not null / int | |
| credit_card_type | string | not null / int | |
| credit_card_number | string | not null / int | |
| credit_card_nominee | string | not null / string | |
| credit_card_effective | string | not null / date | @tododateformatになる可能性あり |
{
"result" : false,
"errors" : {
'payment_method' : '必須項目です|数値で入力してください',
'plan' : '必須項目です|数値で入力してください',
'payment_timing' : '必須項目です|数値で入力してください',
},
"data" : "",
}
{primary} 本機能で取得するデータに対してのvalidationを明記します
| 画面項目名 | フィールド名 | チェック内容 | 備考 |
|---|---|---|---|
| 支払方法 | payment_method | required | |
| numeric | |||
支払方法に「1:クレジットカード払い」を選択している場合はcredit_card_numberの値がリクエストパラメータに含まれるか? |
|||
| プラン人数 | plan | required | |
| numeric | |||
| 支払時期 | payment_timing | required | |
| numeric |
| 物理名 | フィールド名 | 型 | 備考 |
|---|---|---|---|
| 支払方法 | payment_method | tinyint | 1:クレジット, 5:コンビニ払い |
| プラン人数 | plan | int | |
| 支払時期 | payment_timing | tinyint | 1:年払い 5:月払い |
| カード種類 | credit_card_type | tinyint | 1:VISA 5:MASTER 10:JCB 15:AMEX 20:DINERS |
| カード下四桁 | credit_card_number | integer | カード下四桁 |
| カード名義人 | credit_card_nominee | string | カード名義人 |
| カード有効期限 月 | credit_card_effective_month | tinyint | カード有効期限 月 |
| カード有効期限 年 | credit_card_effective_year | tinyint | カード有効期限 年 |