Paypal Payments (Authorization & Capture) not returning Authorization ID - api

According to the documentation the paypal payment method should be able to do Authorization & Capture just fine. The following excerpt under the PayPal authorizations excerpt specifically states how to go about it:
First get payment approval and execute the payment as you normally would do for a PayPal payment. Once you successfully execute on the payment authorization, PayPal responds with a new set of HATEOAS links, including a capture link that you use to capture the payment.
So if im following correctly the flow for doing Authorize & Capture is as follows:
Create a Payment
Redirect User to HATEOAS link approval_url to get them to sign into paypal.
Be returned to success (or cancel, but not in this example) link.
Get the Payment to see what's changed, get the shipping address / etc....
Let the customer review the details
Execute The Payment to commit to the hold on funds.
At this point an AuthorizationID / HATEOAS Link should hold information about the authorization.
Some time later use the authorization ID to Capture, and voila, we're done.
Now this is all fine and dandy, but in my tests on the sandbox environment I'm having trouble retrieving the authorization ID anywhere.
Here's my HATEOAS Links I receive from my Execute Step:
As you can see, only the self reference is returned, according to the documentation there should be one capture link at the least that should have the authorizationID in it.
Also, nowhere in the response body is any authorization ID. However, If I look at the payment in my sandbox paypal dashboard:
And once I drill down into it:
Sure enough if I call the Authorization.Capture API call against 8B633793L37511009 it captures as you would expect. However I can't find a programmatic way to determine this number.
How am I supposed to store the authorization number so my tooling can capture later when our business conditions have been met?

In the beggining, when you create the payment with intent authorize you should be getting an authorization object within the response. This object has the id you need for the capture later.
Check this blog post to see if you're missing something fundamental in the picture.
I followed the tutorial and executed the sample requests via curl. As you can see, I got the authorization id under transactions->related resources->authorization->id
Then I used the id in the URL and successfully captured the payment.
Hope this helps, if it doesn't, please elaborate and maybe I will be able to help you further. Good luck!

Related

How does one associate a website user with a Paypal subscription?

I am implementing subscriptions to a premium service on a website using Paypal as the payment service. I have successfully created a Catalog Product and Billing Plan through the API, and I am able to get to the payment page on Paypal, but it's not clear how I'm supposed to persist a user identifier through the purchase process.
I assumed it would be something along the lines of passing a user id somewhere, but there's nothing in the Paypal documentation about this. I need to be able to let the user make a purchase and have the Paypal webhook send the confirmation to an endpoint on my site, and that's where I'd expect to get their user id to toggle the subscription on their account on my end.
Is there something I'm missing? There has to be a way to do this cause I'd imagine it's a pretty common use case. If anyone has information or has done this before, I'd love to hear. Thanks.
The only truly secure way I've found when using javascript SDK, is to securely generate a unique custom_id on your server side associated with the user.
Then when you create the buttons, the 'createSubscription' function takes custom_id as a parameter.
Then use a webhook to receive events from your subscription and the custom_id will be present in the body of all BILLING.SUBSCRIPTION events under resource.custom_id.
I am able to get to the payment page on PayPal,
You are vague about what you are doing here. There are multiple ways (and some ways have multiple versions) of accepting subscriptions via PayPal, so it is important that you provide full details about the method you are using.
The time to associate a created subscription ID with a user ID is when it is approved, in the onApprove function if you are using a Smart Payment Button: https://developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription

How can I recognize when user has added account in Yodlee Fast Link?

How can I recognize when user has added account in Yodlee Fast Link (for example an investment account) by going to the link.
What I want:
I am creating a link to "Fast Link";
User are following by this link;
He is adding a their account;
And in this point I wanna know that he has added something (for example by callback url). How?
Thanks!
Yes, this can be done. You can have a page hosted that can count the hits and use that page as callback URL in extra params for FastLink.
You can get more information on this at
https://developer.yodlee.com/Fastlink_2.0/FastLink_Integration_Guide_for_Web
The extra parameters that needs to be passed for achieving this is as below
callback=http://google.co.in where here google.co.in is your callback page
Regards,
Vijay
Yodlee have introduced a new event subscription service using webhooks. It is part of their YSL (Yodlee Service Language) product.
It can trigger events for following –
the MFA information is requested by the provider site to log in for
aggregating data
the Yodlee system has performed the login on the provider site
successfully
the Yodlee system has retrieved the account summary information from
the provider site successfully
the final status of account addition or update account APIs
Details -
https://developer.yodlee.com/apidocs/index.php#!/cobrand/eventSubscription
Please NOTE that Webhook event notifications will work only when you try to add the account using YSL APIs (manually).It doesn't work with FastLink. I have been informed by Yodlee Support. They also informed me that till date they don't have any client using webhook service, which was bit scary to know.

Paypal rest api express checkout with no shipping field (WebProfile handling)

I'm using Paypal rest api to make payment
the workflow is:
Create payment
Redirect to approval Url
User approved (return back to my site)
Execute payment
But there's one thing that I don't want users re-filling shipping address again because it was filled in my website.
So I change the workflow to:
Create web profile (set no shipping field)
Get web profile ID
Create payment with experienceProfileId given
Redirect to approval Url
User approved (return back to my site)
Execute payment
But I found this will create a lots WebProfile every time user request payment.
I think it is crazy to do:
create and delete it later again and again
attempt listing WebProfiles and check which is the one I want to use every time while creating payment
store experienceProfileId as a constant
What is the best practice for handling WebProfile or does there any solution just hiding shipping address while user approving payments?
Maybe this is not the answer regarding this "WebProfile". As a fact, I dont know what exactly "WebProfile" does or is.
I worked on the same Workflow these days. As you wrote I needed to predefine some address. For me it was obvious, that I have to do the database-stuff on my Website. Then I exactly define the order, shipping_address, etc. and send the users to Paypal.
If you predefine the new ShippingAddress() to your ´new ItemList()´ by
$itemlist->setShippingAddress($shippingaddress) the user cannot change it within the Process.
http://i.imgur.com/nAg8jxU.png
Maybe this helps you a little.

PayPal Custom variable returned back

I am new to PayPal API, so I have a nooby question.
When I send user from my shopping site to PayPal payment page e.g. https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=xxxxxx&custom=xxxx and I use custom variable with unique ID about product inside my database and when user get returned back to my website thank you page, do I use simple $_GET["custom"] inside my php script to grab that value or I need some PayPal API code implemented inside my website?
Thanks for help.
In order to retrieve this value, you would not be able to get it as you described, however, you can do one of a couple of things:
post the custom value to a cookie or session variable before sending the user to paypal, then retrieving the cookie or session variable value when they are returned from paypal.
(preferred method) implement an IPN listener that will be able to parse the posted transaction details, one of which is the custom value. This method would allow you to confirm a completed transaction as well as do pretty much anything else with the data that you need to do.
Paypal has PHP code samples for an IPN listener on their DEV site. It's pretty easy to implement and follow along.
I hope this helps.
Old thread I know but if I understand the user correctly and he is using the IPN url to collect the returned data he can use $myphpvar = $_POST[custom];
More info # http://www.brianmoreau.com/articles/paypal_buy_now_button_sending_custom_variables.php

About paypal express checkout api

In this picture,there are 3 main steps:SetExpressCheckout,GetExpressCheckoutDetails and DoExpressCheckoutDetails,I'm now sure SetExpressCheckout is to be called by myself,what about GetExpressCheckoutDetails and DoExpressCheckoutDetails,is it called by paypal or by myself?
The api is provided to be called by non-paypal I think,but the problem is seems it's redirected to paypal after calling SetExpressCheckout.
(source: paypal.com)
Yes, you are expected to be the one calling these APIs. After you call SetExpressCheckout, you'll get a token back that represents the checkout you're performing. You'll need to use that token and redirect the user to Paypal to approve the payment. After they approve it, Paypal will redirect back to your site and then you can call GetExpressCheckoutDetails and/or DoExpressCheckoutPayment. The GetExpressCheckoutDetails call is useful for getting things like shipping address, etc, since the buyer can set that stuff as part of the approval flow. Once you have all the info you need, the buyer has approved the payment and you're ready to get paid, then call DoExpressCheckoutPayment to get your money.
See the ExpressCheckout docs for an example of a simple integration.