Closed JCarlosR closed 7 years ago
Q1: I saw it by running the SDK sample code. success=true
is a part of URL.
Q2: Once the customer approve the agreement, and you execute the EC token and completed the payment, you should not be able re-use the EC token. In my situation I was not able to reproduce another agreement by running the sample code Please provide dBugId
.
Q3: Please elaborate what you mean by credit and provide examples.
Q4: Buyer can cancel the subscription from his account. The rest operation should be done through APIs.
Q5: Web experience profile is not supported in Billing agreement at this time. Please see the issue here https://github.com/paypal/PayPal-REST-API-issues/issues/4
Q6 You will need to log in developer.paypal.com dashboard and create a sandbox business account under my account. You can make up an email address whatever you what. You don't have to use real email address.
If Q5 is a critical feature for you, I would encourage you to look in Expresscheckout via Braintree SDK or Braintree Direct PayPal option. instead.
@xiaoleih41 Thank you for your help.
Q1: If I don't get the success=true parameter, it means that the agreement is not being executed? When I was redirected from Paypal to my app, the route only got the token parameter. However the subscriptions were executed (see the next notifications):
And this capture shows how the user is redirected to my app without the success parameter and the agreement is executed:
Q2: I have posted an image before (at the issue description). In my Sandbox API Call History, the column Paypal Debug Id is empty :(
Q3: I mean that the balance of the buyers was not updated. But now I have checked it again and the transfer is registered now. When I created the agreement I added 5 minutes to the start date. I did that because I got errors trying to use the exact datetime. There is a way to leave blank the start date and let Paypal to set the proper dateTime immediately after the user aproval? When the user is redirected to my app I want to execute the agreement and know if the billing was procesed successfully at that moment.
Q4: Ok. Then I will allow the users to suspend/reactivate its subscription. Because if they cancel and create a new one, they will be charged twice. But my concern is, if I set a delay to the start date of 5 minutes, when the user approves the agreement, he/she has to wait 1 or 2 minutes in my app for the subscription activation webhook?
Q5: Okay. It is important because the shipping address is useless for the majority of SaaS.
Q6: I have 4 sandbox accounts, 2 of them are business accounts,but I don't know which will be used to receive the payments. Where I can define that?
Unfortunately Braintree is not available for my country (Peru) :/
Thanks again.
q1 and q2. I am not sure why it is not in the URL. I would strongly recommend you to use our sample code instead. Q3 and Q4: Use setup_fee instead. It will charge instantly. Q6: The one making the API call should be the one receiving the payments.
Very strange, because I am using the sample code. Have you tried with the 1.12.0 sdk version?
I guess that setup_fee
doesn't count as the first payment of the subscription. There is no way to start the subscription immediately after the user approval?
What do you mean? The API call is associated with my app credentials, but doesn't with the sandbox accounts as I have seen.
Thanks.
You define the success=true
in the billing plan return URL here
You can set the setup_fee the same amount as the the first payment and it should be count as the first payment of the subscription.
The APP has to be created from one sandbox account. If you log into developer.paypal.com and click the app, it will tell you which sandbox account it is created under.
I am using the ISO 8601 format for the start_date (when creating a new agreement):
After create the agreement, I get the paypal approval link and redirect the user to that link. When the user has approved the agreement I get the next object: Here, the start_date has a different value. Why?
In the Sandbox API Call History I can see the next: There are two warning icons (cut in half), but I can't see the warning messages. The icons are cut in Chrome but also in Firefox, and I can't see the DebugID that you ask for before.
Thank you again, for your help.
@JCarlosR this issue will explain the start_date
behavior you are seeing https://github.com/paypal/PayPal-Java-SDK/issues/207#issuecomment-255794267. This is also documented https://developer.paypal.com/docs/api/payments.billing-agreements#agreement_create_request
Closing for now, let us know if you have further questions.
@pp-randy Is it possible to know if the first payment was processed successfully immediately? I mean, after the user approves the agreement?
@xiaoleih41 Told me to use a setup_fee
with the same value of the subscription. Is it a not documented trick?
The documentation says "The agreement can take up to 24 hours to activate". Therefore, there is no way to check if the first payment was processed at the moment of the user approval because the operation will be delayed?
Thank you.
@xiaoleih41 is correct about the setup_fee
and it is documented here: payments.billing-plans#definition-merchant_preferences. It can be used with initial_fail_amount_action
as well. The setup_fee
transaction should be relatively soon and does not follow the 24 hour rule, that is why you can use it for same day billing when its needed.
Is the following correct?
No setup fee: A user approves an agreement, and the first payment is processed in the next 24 hours. The second payment will occur in the next month (based on the frequency of the plan).
Using a setup fee with the same amount of the subscription price: A user approves an agreement, and the first payment happens immediately. When the agreement is executed, the response tells to my app if the charge was performed (don't need to listen a webhook for validate the first successful payment, only for future cancels). The setup fee postpone the first payment to the next month.
Is that right?
@JCarlosR The first payment should start at the start date in both situations following the 24 hours rule. You should get the payment complete webhook for the setup fee payment as well.
General information
PayPal-Debug-ID
values:Issue description
P-5CG897082G574680RLISL7CQ
).Question 1: Here, the sample code uses a
success
parameter. However, when the user approves the agreement, the redirect is performed tohttp://localhost.com:8000/paypal/return?token=EC-2PL071170B629453H
(in my case). It means that thesuccess
parameter is not used anymore and the docs have to be updated?Question 2: I am using the following lines to create a new subscription after the agreement is successfully created.
try { // Execute agreement $agreement->execute($token, $this->apiContext);
$subscription = new Subscription(); // [...] $subscription->paypal_agreement_id = $agreement->getId(); $subscription->save(); } catch (PayPalConnectionException $ex) { echo $ex->getCode(); echo $ex->getData(); die($ex); } catch (Exception $ex) { die($ex); }