Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

> Integrating paypal + webhook

views
     
TSPoisonSoul
post Feb 9 2020, 09:45 PM, updated 2w ago

Getting Started
**
Junior Member
292 posts

Joined: Feb 2018


So I'm trying to integrate my web app with Paypal payment gateway for them to subscribe to my service for a fee but I seem to be stuck with some problems.

Just so you know, I'm on Laravel Framework.

This is the intended flow.
1) Users get to choose a subscription or a monthly payment.
2) Once users choose their plan, they proceed to pay.
3) Once they have paid, they can gain full access.

So far, I'm done with the payment. As in the user can be directed to Paypal and be paid to the exact amount that I've intended them to pay and if they choose the subscription, Paypal is able to charge them monthly or yearly according to the subscription. I'm returned with the Order and Subscription ID.


Sounds easy and I'm stuck right? Well, here's where I am stuck at.

1) For subscription basis, I am supposed to charge them for instance, USD99/yearly and I need to capture the returned response from Paypal. Apparently this is done with webhook. I've searched high and low what is webhook and I can't get it to work/understand. Please someone can teach me in layman's term what is webhook and how to "trigger" it.
2) There's a trial plan which I need to do the usual which is charging them USD1 and then cancel the order but I can't seem to do it as it says I need a capture ID but I do not have it anywhere.


These are my sources
1) REST API
2) Smart Payment Button

It would be great if any sifu here is able to help me. Thanks!

funcode
post Feb 10 2020, 04:56 PM

New Member
*
Newbie
17 posts

Joined: Nov 2018
read here https://developer.paypal.com/docs/subscriptions/integrate/
silverhawk
post Feb 11 2020, 05:22 PM

I'm Positively Lustrous
Group Icon
Elite
3,859 posts

Joined: Jan 2003


QUOTE(PoisonSoul @ Feb 9 2020, 09:45 PM)
1) For subscription basis, I am supposed to charge them for instance, USD99/yearly and I need to capture the returned response from Paypal. Apparently this is done with webhook. I've searched high and low what is webhook and I can't get it to work/understand. Please someone can teach me in layman's term what is webhook and how to "trigger" it.

A webhook is simply an API call from the service to your app. If your webhook is registered for a particular event, it will trigger when the event happens then a request is made to your app. So expose an API endpoint for paypal to call, and register that endpoint with paypal.

QUOTE
2) There's a trial plan which I need to do the usual which is charging them USD1 and then cancel the order but I can't seem to do it as it says I need a capture ID but I do not have it anywhere.
These are my sources
1) REST API
2) Smart Payment Button

It would be great if any sifu here is able to help me. Thanks!
*
The USD1 charge should be automatically refunded by paypal, don't think you have to do anything.

bumpo
post Feb 14 2020, 04:40 PM

Casual
***
Junior Member
446 posts

Joined: Mar 2013


if i still recall correctly, almost all payment portal that via web page is integrating via javascript

generalized sequence of events but hopefully it give you some idea what webhook is all about

1) you create some javascript function that does somestuff
2) you import whoever javascript into your page
3) some from of config/param to let the other guy to know what javascript function to call. this is the function you created in (1)
4) you call the whoever javascript function e.g. do payment and that guy will call back ur function when payment done. this is where the other guy's javascript "hooks" back to your javascript.
Agsx
post Yesterday, 07:33 PM

Getting Started
**
Junior Member
212 posts

Joined: Nov 2019

QUOTE(PoisonSoul @ Feb 9 2020, 09:45 PM)
So I'm trying to integrate my web app with Paypal payment gateway for them to subscribe to my service for a fee but I seem to be stuck with some problems.

Just so you know, I'm on Laravel Framework.

This is the intended flow.
1) Users get to choose a subscription or a monthly payment.
2) Once users choose their plan, they proceed to pay.
3) Once they have paid, they can gain full access.

So far, I'm done with the payment. As in the user can be directed to Paypal and be paid to the exact amount that I've intended them to pay and if they choose the subscription, Paypal is able to charge them monthly or yearly according to the subscription. I'm returned with the Order and Subscription ID.
Sounds easy and I'm stuck right? Well, here's where I am stuck at.

1) For subscription basis, I am supposed to charge them for instance, USD99/yearly and I need to capture the returned response from Paypal. Apparently this is done with webhook. I've searched high and low what is webhook and I can't get it to work/understand. Please someone can teach me in layman's term what is webhook and how to "trigger" it.
2) There's a trial plan which I need to do the usual which is charging them USD1 and then cancel the order but I can't seem to do it as it says I need a capture ID but I do not have it anywhere.
These are my sources
1) REST API
2) Smart Payment Button

It would be great if any sifu here is able to help me. Thanks!
*
there are literally a guide at paypal, are u stupid?
alexa
post Yesterday, 08:25 PM

Big Boss
******
Senior Member
1,355 posts

Joined: Jan 2009
From: mont kiara, kuala lumpur



QUOTE(Agsx @ Feb 16 2020, 07:33 PM)
there are literally a guide at paypal, are u stupid?
*
I hope this guy will be in prison after this.

 

Switch to:
| Lo-Fi Version
0.0291sec    2.21    5 queries    GZIP Disabled
Time is now: 17th February 2020 - 07:55 PM