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

リンクタイプ決済の「配送区分」と注文情報の詳細の設定要否を引数で指定できるようにする #116

Merged
merged 6 commits into from
Sep 7, 2020

Conversation

yuriko1211
Copy link
Contributor

@yuriko1211 yuriko1211 commented Sep 3, 2020

実現したいこと

これまで、イプシロンリンクタイプ決済のオーダー情報送信を行うpurchaseメソッドでは 、delivery_code: 99 を無条件で指定していた。そのため注文情報の詳細(注文主・配送先の氏名住所等)をパラメータにセットすることが必須となっていた。

この修正で、新たに追加した引数 delivery_info_required の値で delivery_codeを設定するかを判断するようにした。(false の場合は注文情報の詳細の送信が不要)

なお、delivery_info_requiredを指定しない場合(既存通りamountdetail のみ引数で渡す場合)は、delivery_info_requiredtrueとみなし、これまで通り注文情報の詳細を必須とする。

やったこと

  • purchaseメソッドに引数でdelivery_info_requiredを渡せるようにした
    • delivery_info_requiredの値でdelivery_codeと注文情報の詳細をセットするかを判断できるようにした
  • delivery_info_requiredfalse の場合のテストを追加
  • READMEに上記の仕様について追記

参考: イプシロン決済システム仕様書 Ver.1.0.42 p46

@yuriko1211 yuriko1211 changed the title [WIP]リンクタイプ決済の「配送区分」を固定で設定するのをやめ、注文詳細を任意項目とする [WIP]リンクタイプ決済の「配送区分」と注文情報の詳細 Sep 3, 2020
@yuriko1211 yuriko1211 changed the title [WIP]リンクタイプ決済の「配送区分」と注文情報の詳細 [WIP]リンクタイプ決済の「配送区分」と注文情報の詳細の設定要否を引数で指定できるようにする Sep 3, 2020
@yuriko1211 yuriko1211 changed the title [WIP]リンクタイプ決済の「配送区分」と注文情報の詳細の設定要否を引数で指定できるようにする リンクタイプ決済の「配送区分」と注文情報の詳細の設定要否を引数で指定できるようにする Sep 3, 2020
@yuriko1211 yuriko1211 requested a review from itakurara September 3, 2020 07:40
Copy link
Contributor

@itakurara itakurara left a comment

Choose a reason for hiding this comment

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

実装良さそうです〜
細かいのですが、読んでいて気になった英語的な部分についてコメントしたので
そちらだけご確認お願いします。

@@ -307,6 +307,9 @@ end
EpsilosLinkPaymentGateway is available in all link payments.
For example, GMO Payment After Delivery.

If you don't need send paramaters of delivery information details(e.g. consignee_postal, consignee_name, orderer_postal, and orderer_name), you set `delivery_info_required` to `false`.
When you don't set `delivery_info_required`, you must set purchase_detail to delivery information details.

Copy link
Contributor

Choose a reason for hiding this comment

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

デフォルトはtrueだよ(default value is true.) 的なことをどこかに明記したい気がしました。

あと、英語的な部分でなんとなく気になった点…

don't need send => don't need to send ?

you must set purchase_detail to delivery information details
=>
you must set delivery information details to purchase_detail
(「配送情報詳細を purchase_detail にセットしてね」と言わんとしているのだとしたらこちらな気がしました)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

英文を意味が通るように修正しました。

af0fd43

Default value of `delivery_info_required` is `true`, therefore you must set delivery information details to purchase_detail When you don't set `delivery_info_required`.

delivery_info_required のデフォルト値は true なので、 delivery_info_requiredをセットしない場合は、必ず配達情報の詳細をpurchase_detailに設定してください」の意味になるよう書いてみました。

@@ -15,6 +15,15 @@ def test_epsilon_link_type_purchase_successfull
end
end

def test_epsilon_link_type_not_sending_delivery_information_purchase_successfull
VCR.use_cassette(:epsilon_link_type_not_sending_delivery_information_purchase_successfull) do
Copy link
Contributor

Choose a reason for hiding this comment

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

successfull => successful ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

successfulが正しいです。
テストの中でミススペルしている箇所を直しました。

6df2df7

Copy link
Contributor

@itakurara itakurara left a comment

Choose a reason for hiding this comment

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

対応ありがとうございます。

仕様書の
99固定 GMO後払い決済利用時注文情報の詳細を指定する場合設定。
という一文だけだと、
指定したくない場合に何をセットしたらいいのかとくに書かれていない点と、
「GMO後払い」についてしか言及されていない点がちょっと気になりましたが、
動作が問題ないようならいいと思いますー

@yuriko1211
Copy link
Contributor Author

@itakurara
何パターンcgiを叩いて確認しました。

  • 配送区分=99の時
    • GMO後払いの時
      • responseのstatusは成功
      • 購入者情報・配送先情報の確認画面に遷移する
        • パラメータに設定した購入者情報・配送先情報が確認画面に表示されている
    • PayPayの時
      • responseのstatusは成功
      • PayPayの支払い画面に遷移する(住所情報は表示されない)
  • 配送区分=未設定の時
    • GMO後払いの時
      • responseのstatusは成功
      • 購入者情報・配送先情報の入力画面に遷移する
        • 入力画面で購入者情報・配送先情報を入力後、確認画面に遷移する
    • PayPayの時
      • responseのstatusは成功
      • PayPayの支払い画面に遷移する(住所情報は表示されない)
  • 配送区分=99以外の時
    • GMO後払いの時
      • responseのstatusは失敗
      • エラーコード「349」エラーメッセージ「 指定した配送会社は現在利用できません。」が返却される

また、仕様書p51に下記のような記載があったため、このPRでの対応内容で問題ないと思います。
スクリーンショット 2020-09-07 14 42 55

Copy link
Contributor

@itakurara itakurara left a comment

Choose a reason for hiding this comment

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

調査ありがとうございました!
問題なさそうですねー 👌

@yuriko1211
Copy link
Contributor Author

レビューありがとうございました。
マージします。

@yuriko1211 yuriko1211 merged commit ebd9357 into master Sep 7, 2020
@yuriko1211 yuriko1211 deleted the can-select-to-send-delivery-information branch September 7, 2020 06:00
@yuriko1211 yuriko1211 mentioned this pull request Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants