-
Notifications
You must be signed in to change notification settings - Fork 11
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
クレジットカード決済を3Dセキュア2.0に対応する #121
Conversation
30e13a9
to
b908cfb
Compare
RISK_BASE_AUTH_PARAMS_KEYS = %i[ | ||
tds_flag billAddrCity billAddrCountry billAddrLine1 billAddrLine2 billAddrLine3 | ||
billAddrPostCode billAddrState shipAddrCity shipAddrCountry shipAddrLine1 shipAddrLine2 | ||
shipAddrLine3 shipAddrPostCode shipAddrState chAccAgeInd chAccChange | ||
chAccChangeIndchAccDate chAccPwdChange chAccPwChangeInd nbPurchaseAccount paymentAccAge | ||
paymentAccInd provisionAttemptsDay shipAddressUsage shipAddressUsageInd shipNameIndicator | ||
suspiciousAccActivity txnActivityDay txnActivityYear threeDSReqAuthData threeDSReqAuthMethod | ||
threeDSReqAuthTimestamp addrMatch cardholderName homePhone mobilePhone | ||
workPhone challengeInd deliveryEmailAddress deliveryTimeframe giftCardAmount | ||
giftCardCount preOrderDate preOrderPurchaseInd reorderItemsInd shipIndicator | ||
].freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
giftCardCount preOrderDate preOrderPurchaseInd reorderItemsInd shipIndicator | ||
].freeze | ||
|
||
THREE_D_SECURE_2_INDICATORS = [21, 22].freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAILURE = '0' | ||
SUCCESS = '1' | ||
THREE_D_SECURE_1 = '5' | ||
THREE_D_SECURE_2 = '6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tds_flag: 21 # 21 or 22 | ||
# optional: | ||
# add params for risk-based certification(billAddrCity etc...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
仕様書の要件を満たしておりよさそうに思いました〜!
LGTMです 👍
params.merge!(detail.slice(*RISK_BASE_AUTH_PARAMS_KEYS).compact) | ||
end | ||
|
||
commit(PATHS[:registered_purchase], params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
値は変わらないのですが、こちらは:purchase
ではないでしょうか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:purchase
が正しいですね...!修正します!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正確認しました!ありがとうございます。LGTMです
2a56f62
to
a95302b
Compare
イプシロンのAPI改修が終わり正常にレスポンスが返ってくるようになったので
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
取り直したVCRカセットを用いて、テストが成功していることを確認しました。LGTMです!
@@ -5,7 +5,7 @@ http_interactions: | |||
uri: https://secure.epsilon.jp/cgi-bin/order/direct_card_payment.cgi | |||
body: | |||
encoding: UTF-8 | |||
string: contract_code=[CONTRACT_CODE]&user_id=U1663229130&user_name=YAMADA+Taro&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O30189731&st_code=10000-0000-0000&mission_code=1&item_price=1000&process_code=1&card_st_code=&pay_time=&tds_check_code=1&user_agent=ActiveMerchant%3A%3AEpsilon-0.13.0&token=03d4a2ce2f747c9223a4ead24888d0293ad26c06273e296f9faa0675f99a1ff7&security_code=&security_check=1&tds_flag=21 | |||
string: contract_code=[CONTRACT_CODE]&user_id=124014051&user_name=YAMADA+TARO&user_mail_add=yamada-taro%40example.com&item_code=ITEM001&item_name=Greate+Product&order_number=O1663728963&st_code=10000-0000-0000&mission_code=1&item_price=1000&process_code=2&card_st_code=&pay_time=&xml=1&tds_flag=21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
process_code=2で、test_helperの設定した情報でカセットが取り直せていることを確認しました
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
目的
3Dセキュア1.0は2022年10月13日に閉塞されるので、3Dセキュア2.0に対応できるようにします。
変更内容詳細や仕様書はイプシロンからのお知らせにあります。
対応内容は以下です。
purchase
とregistered_purchase
に対応registered_recurring
)は3Dセキュア対応のクレジットカードが利用できないので対応していないregistered_purchase
のテストも登録済み課金 + 3Dセキュア2.0用のVCRカセットを使用registered_purchase
のテストは一時的に他のVCRカセットを使って追加