内容简介:Fuck you PayPal, fuck you so fucking much!The API is the worst, the documentation is confusing, nothing works as expected.I've been trying to get PayPal integrated to add some paid plans onGoNevis.com. Been dealing PayPal API to work with the backend and f
Fuck you PayPal, fuck you so fucking much!
The API is the worst, the documentation is confusing, nothing works as expected.
I've been trying to get PayPal integrated to add some paid plans onGoNevis.com. Been dealing PayPal API to work with the backend and frontend part.
The Subscription payment flow is annoying:
- Make the subscription plans in PayPal account ( alright, this is what most of the payment gateways would do , that's ok! )
- Keep the PLAN ID and its data for later use in the database.
- User decides to subscribe for a Plan:
- Make a billing agreement with the created Plan ID.
- API response was successful:
- Find the approval_link from the API response.
- Redirect to the page.
- User Approve the Billing Agreement
- Return User to the Plan.success_url containing a "token".
- Get the token, use it to execute it Billing Agreement.
- SUCCESS:
- You and customer, live happily after!
- Show user a thank you page or just shut up and give them the premium features.
- Be sure to send an email to them and let them know you appreciate
- FAILED
- Swallow sadness because you just lost a client.
- Now debug why it failed and why you weren't able to catch that in your more than 50 unit tests and integration tests (Why you even bother writing those).
- User Cancels the billing Agreement:
- User will be returned to Plan.cancel_url.
- API response failed:
- Find the reason if you can and loose.
- Meanwhile the purchase is lost.
- Client will be looking at Ghost or WordPress.
- Swallow sadness.
In the above explanation I might have missed couple of steps, I have documented all of this on the code as well, so future me or my son or future generations after my death won't curse me while my body is shaking in the grave.
Alright, up until now I am alright with the hassle of integrating PayPal and I wouldn't even write this blog.
You know what made me to write this ? The IPN, I nstant P ayment N otification.
While looking at IPN, you will see PDT and also WebHooks, which one to choose, the one that you find more annoying of course, which one is more annoying ? apparently all of them. It seems IPN is more reliable than others.
OK, so what happened ?
For last couple of days I'm just trying to get the IPN working via the IPN Simulator in my local machine and on staging server, but that doesn't work!
When you receive a payment, PayPal will send ( HTTP POST ) you a notification about the payment ( and of course other actions ) you get the data, before processing it, you need to verify it with PayPal and no matter what I have tried, the verification failed, no matter what I did.
I tested it with Python, PHP, NodeJS, curl and nothing worked. I searched everywhere to find out why.
I think it took me 2-3 days to finally find a link to find out it's actually a bug on IPN sandbox, means it's actually a bug within PayPal server ( I'm lazy to get the github issue now ). The same code would work in the Production environment, but not the Sandbox!
You may be thinking PayPal is just like any other company, they have bugs and they fix it eventually, yes! Well, just like how they handle Open Cases and side with fucking fraudster buyers and decide in their favor. The same way I guess they limit your account because why not!
Damn it, I've been dealing with this madness for 2 days in row and now I see this is actually broken on staging/IPN simulator.
A free, open source project with one man running the whole show would have handle this by now, we're talking about evil-money-eating-always-on buyer-side-annoying-for-seller PayPal.
If you're not able to fix this, at least update the bug report so people know, that's fine if you're not working on a fix, but just let developers know.
Anyway, I've started writing this post around 1-2 year ago and it was in Draft.
We did implement the PayPal payment for GoNevis, all the features and solid error handling were made with tears. However we dropped it, legally we were not allowed to use them. Why ? because of my nationality as being an Iranian. You can read more about such problem in How I didn't get my first paying customer! (section: PayPal, the Evil, the Pain, the Stupid! )
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
乔布斯离开了,马斯克来了
[日]竹内一正 / 干太阳 / 中信出版社 / 2015-11
在电动汽车的创新上,特斯拉抓住了一个群体的独特需求,外形很酷,不烧油,智能化控制。所有的颠覆式创新都不是敲锣打鼓来的,而是隐藏在一片噪声里,马斯克给我们带来的特斯拉虽然不尽完美,但他做产品的思维和执着于未来的勇气,值得学习。埃隆•马斯克创办公司也不是为了赚钱,而是为了拯救人类和地球,电动汽车、太阳能发电、宇宙火箭,不管是哪一项都足以令一个国家付出巨大的代价去研究开发,但埃隆•马斯克却一个人在做这些......一起来看看 《乔布斯离开了,马斯克来了》 这本书的介绍吧!