Magento自定义付款方式 [英] Magento custom payment method

查看:65
本文介绍了Magento自定义付款方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将解释我所需要的流程:结帐过程是相同的,现在,在最后一步中,我正在对外部URL执行POST,处理所有数据,我等待外部服务器的响应,处理完之后,我进行相应的步骤,1-将订单保存在数据库中或2-给出错误消息.它取决于响应,然后,要保存订单,我需要拥有所有卡的详细信息,如果我没有它,magento给我一个错误,出于安全原因,外部服务器不会返回卡的详细信息,并且他们说不会,所以,我需要保留所有这些信息,直到我可以保存或拒绝为止,我的问题是:我在这里可以做什么?将卡的详细信息保存在cookie中?还是会话变量?还是我还有其他选择?

i'm going to explain the flow of what i need: the checkout process is the same, now, in the last step, i'm doing POST to an external URL, where all the data is processed, i wait to the response of the external server, after process it, i make the correspondient step, 1- Save the order in the db or 2- Give an error message. it depend on the response, then, to save the order i need to have all the card details, if i don't have it, magento give me an error, the external server doesn't return the card details for security reason, and they said the won't, so, i need to keep alive all this information until i can save it or refuse it, my question: What can i do here? Save the card details in a cookie? or a session variable?? or do i have another opcion??

谢谢

推荐答案

由于这是一个非常重要的主题(imo),答案有点复杂,因此我决定对此写一个相当冗长的答案.

As this is a really important topic (imo) and the answers are a bit complicated i decided to write a rather lenghy response about this.

那么自定义付款方式(尤其是magento)的主要方面是什么?

So what are the main aspects with custom payment methods and especially with magento?

  • 很可能不允许您存储和/或传输信用卡信息.但是,您可以存储类似的内容,因此客户不必一直重新输入他/她的信息.我待会儿再说.

  • You are most likely not allowed to store and or transmit credit card information. However you can store something similar so the customer doesn't have to re-enter his/her information all the time. I will come to that later.

Magento是一个非常灵活且功能强大的应用程序(但是该死的太慢了).您几乎可以做任何事.但是,在结帐处理方面,流程必须遵守某些限制,这有充分的理由.

Magento is a very flexible and powerful application (however it is damn slow). You can do almost anything. But when it comes to checkout processing the flow has to obey certain limitations, with good reasons.

结帐处理步骤应封装为单元.您正在尝试包装一个单元,这几乎肯定是一个非常糟糕的主意.

Checkout processing steps should be capsulated into units. You are trying to wrap apart one unit which is almost certainly a very bad idea.

因此,我不想说的是,应在处理付款的SAME提供商处输入信用卡信息.没有其他的.曾经.

So what I want't to say is that the Credit Card information should be entered at the SAME provider that processes the payment. Nothing else. Ever.

我的意思是那很荒谬...考虑一下.请提供您的贝宝凭据,然后我们将为您付款..."

I mean thats just absurd... Think about it. "Please provide your paypal credentials, we will then do the payment for you..."

另一方面,如果您认证的信用卡支付提供商,则您的交易(听起来绝对不安全)是在内部处理的,作为提供商的您就像黑盒子一样.即使是您的商店.

On the other hand if you are a certified credit card payment provider you this transaction of yours (which sounds absolutely insecure) is handled internally and you as a provider are like a black box. Even for your shop.

如果您真的希望可以在内部进行验证交易等.为了使您走上正确的路,我有此代码为您提供帮助,从而使您走上正确的路.我基本上是从magento论坛复制它的,并对其进行了一些调整,以解决一些常见问题,例如数家商店,超级产品,定制价格,特价等.

If you really want that you can internally do your verification transaction etc. To get you on the right track with that i have this code for you which should bring you on the right track. I essentially copied it from magento forum and tweaked it a bit to work with the usual issues like several shops, super products, custom prices, special prices and so on.

但是我认为您应该真正考虑您要完成的事情的方法.

However i think you should really re consider your approach for whatever you are trying to accomplish.

最后但并非最不重要的是,如上所述,有一种方法可以将卡信息存储"在提供者处.例如, Ogone 使您可以与客户一起发送客户令牌,并且如果再次出现相同的令牌他们只需预先填写所有信息,客户只需单击付款"即可.

Last but not least as i mentioned above, there are way to "store" the card information at the provider. For example Ogone offers you the possibility to send a customer token along with the customer, and if the same token appears again they just pre-fill out all the information and the customer just has to click "pay".

他们还为您提供自定义付款页面的功能,并拥有您自己的个性,这样用户基本上就不会意识到自己正在离开您的商店.它们还具有用于magento的稳定模块,这些模块的工作原理就像一个魅力,并且非常可定制.Maby那就是您想要的...

They also offer you to customzie the payment pages and have your own vohst so that the user essentially doesn't realise he/she is even leaving your shop. They also have steady modules for magento that work like a charm and are pretty customizeable. Maby thats what you want...

如果我没有回答你的问题,至少是间接的,我恳请你重新写下你的问题,更清楚地说明你到底想要什么,特别是你的意图是什么.意味着您最终要完成的工作.也许有更好的方法!

If I didn't answer your question, at least in an indirect way, I would kindly ask you to re write your question and put more clearly what you exactly wan't and expecially what your intentions are. Meaning what you are trying to accomplish in the end. Perhaps there are better approaches!

问候,乔

这篇关于Magento自定义付款方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆