Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal Integration, how would I define the receiver account?

Tags:

php

paypal

I'm working on a very small ecommerce software that allows users to put their products up in order to get customers to see them and buy them.

I would like to offer the paypal option and therefore working on creating a module for it.

I started out with this:

http://sanwebe.com/assets/paypal-express-checkout/

Which got me started pretty good, but my "problem" is now that the receiver is automatically the API username?

That is what i can see in the RECEIVEREMAIL parameter value from the response that I get from paypal after an payment.

I would like the receiver to be my users email which i got in the db. So that they get the payment directly into their account.

So I would need to specify the email/paypal account email somewhere in the code?

Hope somebody can explain me how this would be done, I can understand it may not be possible doing while in sandbox mode - but can someone clarify that API information is one thing and receiver is another?

Update: I just found out I can have

&[email protected]

in my call to PayPal. Although this still does not work, it still shows the dev. api username.

Here's another with the same question, but left unanswered:

Doesn't the SELLERPAYPALACCOUNTID work in the sandbox?

like image 294
Karem Avatar asked Mar 22 '14 00:03

Karem


People also ask

How do I authorize a PayPal account?

Basic authorization processYou send your buyer through the payment flow and pass the paymentaction variable, which you set to authorization or order . After your buyer completes checkout, use the payment's transaction ID with authorization and capture in the PayPal website.

What does the PayPal API allow developers to do?

You can accept an immediate payment or authorize a payment and capture it later. You can show details for completed payments, refunds, and authorizations. You can make full or partial refunds. You also can void or re-authorize authorizations.

What does capture mean on PayPal?

Authorize and capture allows you to authorize your buyers' funds before you capture them. An authorization places a hold on the funds and is valid for 29 days.


1 Answers

Your users need to Grant API Permissions for your application to make API calls on their behalf. Then you would still use your own API username, password, and signature, but you'd also include a SUBJECT parameter along with those. The SUBJECT value would be the email address or PayPal merchant ID of a user who has granted permissions for your app.

Users can grant permissions manually through their PayPal profile, or you can build this into your app using the Permissions API. If you go with the permissions API, though, you end up using tokens in the header (OAuth) as opposed to the SUBJECT parameter.

== EDIT ==

It seems that this must have been updated in an API version release or something. I just ran the following in the sandbox with no issues.

[REQUESTDATA] => Array
    (
        [USER] => sandbo_1215254764_biz_api1.angelleye.com
        [PWD] => 12xxxx74
        [VERSION] => 109.0
        [BUTTONSOURCE] => AngellEYE_PHPClass
        [SIGNATURE] => AiKZhEExxxxxxxxz2qxKx96W18v
        [METHOD] => DoExpressCheckoutPayment
        [TOKEN] => EC-9SG69555XT1155150
        [PAYERID] => YW66KXBKJRRES
        [RETURNFMFDETAILS] => 1
        [PAYMENTREQUEST_0_AMT] => 100.00
        [PAYMENTREQUEST_0_CURRENCYCODE] => USD
        [PAYMENTREQUEST_0_ITEMAMT] => 80.00
        [PAYMENTREQUEST_0_SHIPPINGAMT] => 15.00
        [PAYMENTREQUEST_0_TAXAMT] => 5.00
        [PAYMENTREQUEST_0_DESC] => This is a test order.
        [PAYMENTREQUEST_0_NOTETEXT] => This is a test note before ever having left the web site.
        [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
        [PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID] => [email protected]
        [L_PAYMENTREQUEST_0_NAME0] => Widget 123
        [L_PAYMENTREQUEST_0_DESC0] => Widget 123
        [L_PAYMENTREQUEST_0_AMT0] => 40.00
        [L_PAYMENTREQUEST_0_NUMBER0] => 123
        [L_PAYMENTREQUEST_0_QTY0] => 1
        [L_PAYMENTREQUEST_0_ITEMURL0] => http://www.angelleye.com/products/123.php
        [L_PAYMENTREQUEST_0_NAME1] => Widget 456
        [L_PAYMENTREQUEST_0_DESC1] => Widget 456
        [L_PAYMENTREQUEST_0_AMT1] => 40.00
        [L_PAYMENTREQUEST_0_NUMBER1] => 456
        [L_PAYMENTREQUEST_0_QTY1] => 1
        [L_PAYMENTREQUEST_0_ITEMURL1] => http://www.angelleye.com/products/456.php
    )

The payment wound up in the [email protected] account. Just make sure you have the same value set in both SetExpressCheckout and DoExpressCheckoutPayment and you should be fine.

like image 128
Drew Angell Avatar answered Nov 19 '22 11:11

Drew Angell