I'm building an application where a user can connect their own Paypal account through Paypal Permissions SDK (https://github.com/paypal/permissions-sdk-ruby). I was able to successfully get permission from the user and was able to store the tokens that were returned from the Paypal Permissions SDK. Now, I am using the following gem for Express Checkout (https://github.com/nov/paypal-express). But the documentation for Paypal Express Checkout on behalf of a user is not clear on how we should use the tokens to invoke a call for Express Checkout.
I have the following codes
#api = PayPal::SDK::Permissions::API.new({
token: #credential.paypal_access_token,
token_secret: #credential.paypal_secret_token
})
Where #credential is my object stored in the database that has the tokens from the Paypal Permissions SDK.
Now after getting, I can use the #api object to get Paypal Username, Password, and Signature
request = Paypal::Express::Request.new(
:username => #api.config.username,
:password => #api.config.password,
:signature => #api.config.signature
)
Now, my problem is that the money isn't going directly to the users paypal account but it is going to our account (we made an account so that we can create a Application in the Classic API part of Paypal).
Is there anyone who can help me? or point me to the right direction?
When calling API on behalf of other account, you need to add parameter "subject" to indicate the account that you are calling API for. The value of "subject" could be the account primary email address or payerID. Then the money will go to the account which was the value of subject.
Yihui gave the right answer. But I wanted to explain/post here what I did to fix my problem (using Yihui's guidance).
You need to get the Payer ID from the 3rd Party Permissions SDK of Paypal. So you will need to ask for the following "ACCESS_BASIC_PERSONAL_DATA", "EXPRESS_CHECKOUT", and "REFUND".
Then you will need to use the NVP (Name Value Pair) SDK of paypal to perform Express Checkout on behalf of another party/merchant.
For more information, we followed the following article of Paypal
https://developer.paypal.com/docs/classic/express-checkout/ht_ec-singleItemPayment-curl-etc/
Related
We are developing a mobile app.
In this app we want our END USER to able to login with there email id + the password they have from our zendesk.
I can not find any way to let a END USER login with email + password. And after that, make tickets and see his open tickets.
We are using the CORE API at this point.
Have you had a look at the docs for the iOS and Android SDKs?
You can set up an AnonymousIdentity with email and name after your users auth into your app. This will give you an identity which can be used to create tickets.
There are limitations with AnonymousIdentity, described in the docs. The other option is JwtIdentity, this requires a bit of backend development to get up and running.
I am using paypal-adaptive gem in myapp and i have multiple receivers
there, one is admin and second one is project owner.Now I want to
verify each project owner email using paypal and need following steps
:
In Project owner account settings there is a form containing input
PayPal Email & name of project owner
When click one submit ,it should redirect to paypal and project
owner should login in Paypal to verify application & redirect to my
app & get verified .
This might help if you are still looking:
The GetVerifiedStatus API operation lets you determine whether the
specified PayPal account's status is verified or unverified.
A PayPal account achieves verified status under a variety of
circumstances, such as when an account is linked to a verified funding
source. Verified status indicates a trust relationship. For more
information about verified status, see the Frequently asked questions
about the verification process.
Note: In addition to GetVerifiedStatus, you can use Log In with PayPal or the Permissions API to gather information about PayPal users. Please see the documentation of these interfaces for more information.
Read more on document: https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-accounts/GetVerifiedStatus_API_Operation/
I have create the basics of subscription Paypal using the RailsCast and now I'm doing what is missing there.
Now I'm developing the process to do the Devise user registration together/just after the payment is done. For now, I'm trying something like this and this.
As the RailsCast got the e-mail from PayPal using this line:
#subscription.email = PayPal::Recurring.new(token: params[:token]).checkout_details.email
So, I thought that I could get first name, middle name and last name from PayPal as well. From PayPal documentation it seems that it is possible but I couldn't get it through paypal-recurring gem.
I have tried to see if I can learn what I have to do from paypal-recurring GitHub docs and code but I couln't find and tried some possibilities without success.
Is it possible? Maybe in another way not using paypal-recurring gem?
If you have another recomendation/reference to do this registration process, please, let me know.
Update
As #Andrew suggested PayPal IPN, I thought it would be better update my question as I want to have the first_name from PayPal as a default value to ease the process to the user register in my database but he or she may want to change to another name.
The process that I want is something like:
The user chooses his plan and to pay with PayPal
User is sent to PayPal
User fills payment info on PayPal site
User is sent again to my site
My site gets e-mail and name of the user from PayPal and asks the user to confirm or change the data, and provide his password to create the login to my site
My site uses the user data provided to register the user and sends the request to PayPal to request the payment and create the recurring profile
Ok, based on your current outline of steps you can handle that exact flow using Express Checkout.
SetExpressCheckout will generate a token for you, and you then redirect the user to PayPal. They review and approve the payment and are then redirected back to your site. There you can call GetExpressCheckoutDetails to obtain the email, name, address, etc. and display a final review page for the customer to confirm everything or make changes if necessary. Finally, you'd call DoExpressCheckoutPayment to finalize the payment using the customers confirmed details.
I would look at PayPal IPN (Instant Payment Notification). It'll POST transaction details to a listener script you have sitting on your server so you can process the data accordingly in real-time.
I'm using this gem for payments in my rails app:
https://github.com/jpablobr/active_paypal_adaptive_payment
I can not make a refund, I get the next message in response log:
...refund_status="NO_API_ACCESS_TO_RECEIVER">]> response_envelope=#<Hashie::Rash ack="Success"....
I am using the pay_key for make a refund.
Its possible fix this error?
Thank you so much!
Ok the problem was, For a receiver to grant permission to refund to the API Caller:
Login to www.paypal.com (For Sandbox: www.sandbox.paypal.com - Make sure you are already signed in https://developer.paypal.com) and login with the receiver account. Goto Profile -> API Access -> Grant API Permission -> Input the API Caller (Example: May6_1307031077_biz_api1.paypal.com) in Third Party Permission Username textbos and click Lookup button -> Enable checkbox for "Issue a refund for a specific transaction" and click Add button.
This is how receiver can grant permission to API Caller.
Once this is enabled, the refund should work.
Founded in https://www.x.com/developers/paypal/forums/adaptive-payments-api/adaptive-refund-notprocessed
Edited.......
You can see on https://www.x.com/devzone/articles/paypal-permissions-and-advantages-integrating-permissions-api If you need make this feature with Api you can use this gem:
https://github.com/moshbit/paypal_permissions
Thank you very much!
I was having the exact same problem and my issue could not be resolved by the accepted solution. My problem was that I sent money from a merchant account to a seller account and was trying to refund the transaction, but there is (currently) no way to grant API permissions from a personal account to allow the refund transaction to go through. I just called Paypal, and they said that there's no way to complete the refund I was attempting to do, but since I only needed the refund for testing purposes (to make sure there was always money in my merchant account), they suggested that I instead just send an equal payment from my personal account back to my merchant account. I hope this helps someone.
I'm successfully using Paypal Express Checkout in a marketplace web app passing for every seller the three parameters to the PaypalExpressGateway (login, password and signature).
So, I see that Shopify lets the seller set only the e-mail address of the Paypal account requesting to grant scott_api1.jadedpixel.com as the API Partner Username.
I could't find anything in the ActiveMerchant doc on how I can do it...Someone can help?
Thanks a lot,
zetarun
We use PayPals "Accelerated Boarding" method of setup for Express. They should send you an email after the first attempted sale with a link that automatically sets up the correct API settings.
To manually set them up, you can follow the instructions listed in our PayPal wiki, http://wiki.shopify.com/PayPal which are as follows:
Third-party authentication: Grant Shopify the appropriate API authentication permissions
1. Log in to your PayPal account and click the Profile subtab.
2. Click the API Access link in the Account Information column.
3. Click the Grant API Permission link.
4. In the Enter an API Partner Username field, enter scott_api1.jadedpixel.com.
5. Check the following API permissions:
* Express_Checkout
* Direct_Payment
* Admin_API
* Auth_Settle
6. Click the Save button.
Best regards,
Mike # Shopify
Ask the client to grant permissions on paypal and pass in the client's paypal email as :subject when creating an instance of the gateway:
ActiveMerchant::Billing::PaypalExpressGateway.new(
:login => '...', :password => '...', :signature => '...',
:subject => 'client#example.com')