duanpenpan5796 2013-10-31 17:00
浏览 32
已采纳

Omnipay与3D安全

I'm trying to create a custom gateway using omnipay for an unsupported payment gateway. However I'm having a difficult time creating the response class for my provider's 3D secure implementation.

I've had a look at sagepay, but the response for 3D secure seems to all be returned in 1 api request.

To complete a 3D secure payment I need to perform the following actions:

  1. API request to check if the card is enrolled in 3D secure
  2. Redirect the user (POST - Hidden Form) to a url
  3. API request to verify the 3D secure value
  4. Make the payment (PurchaseRequest)

Do I need a different response classes for each api request? So VerifyEnrolledResponse, VerifySigResponse and PurchaseResponse?

or do I need something like this:

if ($response->isSuccessful()) {
    // payment was successful
} elseif ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} elseif ($response->notEnrolled() {
    // User not enrolled in 3D secure - make auth or display error
} elseif ($response->3DSecureSuccess() {
    // Card passed 3D secure
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

Really lost here, I want to keep it abstracted with isSuccessful(), isRedirect() etc. Any help is really appreciated.

Documentation: https://resourcecentre.globaliris.com/documents/pdf.html?id=98

  • 写回答

1条回答 默认 最新

  • dongzhaobai5982 2013-11-01 19:45
    关注

    It looks like global iris does things differently, in that they require you to make the 3d secure request separately to the initial charge. So there are three steps (request 3dsecure, verify 3dsecure, make payment).

    To keep things in line with the omnipay way of doing things I would combine the last two steps. So when you call purchase(), make the 3ds-verifyenrolled request and return a redirect response if the request is successful.

    Then, when the customer returns from 3dsecure, in your completePurchase() method, first verify the 3dsecure signature, then if the signature/3dsecure was successful, make a payment request to their server and return the response.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 删除虚拟显示器驱动 删除所有 Xorg 配置文件 删除显示器缓存文件 重启系统 可是依旧无法退出虚拟显示器
  • ¥15 vscode程序一直报同样的错,如何解决?
  • ¥15 关于使用unity中遇到的问题
  • ¥15 开放世界如何写线性关卡的用例(类似原神)
  • ¥15 关于并联谐振电磁感应加热
  • ¥60 请查询全国几个煤炭大省近十年的煤炭铁路及公路的货物周转量
  • ¥15 请帮我看看我这道c语言题到底漏了哪种情况吧!
  • ¥66 如何制作支付宝扫码跳转到发红包界面
  • ¥15 pnpm 下载element-plus
  • ¥15 解决编写PyDracula时遇到的问题