PHP Paypal plus Integrate Pay upon Invoice - php

I integrated Paypal Plus in my page and everything worked well in "Sandbox" mode, now I changed the mode to "live" and the Pay upon Invoice selection in my Payment wall somehow disappeared.
My js code for Payment wall is
var ppp = PAYPAL.apps.PPP({
"approvalUrl": "<?=$approvalUrl?>",
"placeholder": "ppplus",
"mode": "live",
"country": "DE",
"language": "de_DE",
useraction: "commit",
buttonLocation: "outside"
I'm little bit confused about this whole Invoice thing... do I have to change something in my PHP code to use it or do I actually have to create an new Invoice() instead of new payment()? Until now I just created a new Payment() and filled all information (prices, shipping adress) into it and used the approval_url to render the payment wall. Where is my error?
Thank you very much

I guess that "pay upon invoice" is not unlocked by paypal for your account. You have to apply for it.

Related

how do i link paypal account with online store using php

I am not sure what this is called but here is what i am looking to do.
I am trying to make a php script that will create a link between our store account and paypal buyer, so that when they click our buy button it will process the payment without any future confirmations or user actions.
I have tried the paypal sdks and integration wizard no luck, Does anyone know of a working example of what i am trying to do?
Billing agreement(also called Reference Transactions) allows customer to agree the payment once on your website or app, then you call an API with the billing agreement ID to tell PayPal to charge the customer. Please see document here . You will need to contact PayPal to enable you to use Billing agreement, it's not easy to get approval:(
Integrating Paypal buttons are pretty straightforward.
Go to your merchant account.
Go to your Create Paypal Button page.
Choose whatever the button types you want. Configure it with Price etc.
Now just copy and paste the code generated.
It just works.
P.S
There is an option in your merchant account page to set the returning address from Paypal. You can set a returning page and catch all the transaction details via HTTP Post method when it is called by Paypal.
There is this Sandbox account type in Paypal which you can do a lot of playing with.

PayPal - Unable to verify the payment using Transaction ID (GetTransactionDetails API)

There are a lot of discussions about similar issues but I couldn’t find the exact answer.
Here is the problem:
I’m trying to integrate in-app payment in Android OS using the latest PayPal MSDK library. The integration was straight forward, I could make successful single payment, receive proper response and the things was OK until I have to verify the mobile payment
In the mobile app(using PayPalConfiguration.ENVIRONMENT_SANDBOX), I receive the following response:
{
"client": {
"environment": "sandbox",
"paypal_sdk_version": "2.2.2",
"platform": "Android",
"product_name": "PayPal-Android-SDK"
},
"response": {
"create_time": "2014-08-05T19:49:19Z",
"id": "PAY-0D205735ER3716140KPQTKPY",
"intent": "sale",
"state": "approved"
},
"response_type": "payment"
}
As you can see, the transaction ID is: PAY-0D205735ER3716140KPQTKPY
When I try to verify the payment by making request with this transaction ID from my server to PayPal, the response is always the same:
{
"Errors":
[
{
"L_ERRORCODE":"10004",
"L_SHORTMESSAGE":"Transaction refused because of an invalid argument. See additional error messages for details.",
"L_LONGMESSAGE":"The transaction id is not valid",
"L_SEVERITYCODE":"Error"
}
]
}
When I check in PayPal Sandbox test account site -> Notifications, the test transactions ids are completely different. For the above transaction, the transaction id is:
5DY75733624918945
If I use this transaction ID in my verification request – the response from the PayPal is OK.
According the documentation, I should use the id from the mobile app response (moreover – I do not know other way to retrieve a transaction id…).
I'm using a test sandbox account, tried with different type of payment (PayPal button and CC), tried even with real transactions - the result is the same.
Do you guys know why they are different?
Please take a closer look at https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/
The SDK returns a payment ID which can be used to retrieve a payment resource using GET. The payment will contain one or more transactions (in your case, a single sale transaction) in the related_resources section.

Paypal options for "Pay now" button integration (PHP)

I have rolled out my own shopping cart website in PHP, and I want to add a "Pay Now" button which:
Sends the user to Paypal with a total amount payable
Allows the user to pay with or without a paypal account of their own
Prevent user from hacking around with the final amount (e.g. plain text attributes in HTML)
and I want a solution where I do not pay any monthly Paypal fees. But I'm finding the Paypal documentation seriously confusing, as well as other SO questions:
Paypal: Paypal Button Manager overview
SO: Paypal Pay Now Button
SO: php basic pay now button for paypal
SO: PayPal: express checkout pay without account
The Paypal documentation suggests that if I want a "Pay Now" button, the only option I have is to use "Hosted Sole Solution only". What exactly does this mean?
It also says "You cannot use hosted buttons with Hosted Sole Solution; you should use token buttons instead." Please forgive the stupid question, but this means if I want a Paypal "Pay Now" button, I have to use the "Hosted Sole Solution", which always uses "Tokens"? How exactly does the "Token" scheme work? Other questions suggest data is sent in plain text so can be hacked around with, yet the concept of tokens seems to suggest otherwise?
And last but not least, are there any examples of PHP code for the "Pay Now" button? I'm mystified why it all has to be so confusing!! (I'm comfortable with PHP, but to really understand how the Paypal "Pay Now" system works, examples would be ideal)
In case it matters, I will also want to use Paypal IPN, but I have done this before, so will regard it as a separate task, unless it has to be considered for the "Pay Now" button.
The big factor here is going to be the fact that you do not want to pay a monthly fee. This will limit you to using PayPal Payments Standard / Express Checkout, both of which have no monthly cost.
PayPal Standard are your "Pay now" buttons. They are nothing more than an HTML post form and can be created within your PayPal account's button factory, or you can create your own forms.
PayPal Express Checkout is an API based solution which in the absence of a shopping cart platform will perform nearly identically to PayPal Standard. Express Checkout does not allow the customer to checkout as a guest by default, additional variables (solutiontype=sole) need to be passed with the initial API call.
It sounds to me like PayPal Standard is going to be the product you are after. Here is a link to the base "developer" guide for PayPal Standard:
https://developer.paypal.com/webapps/developer/docs/integration/web/
If you prefer to create the buttons through the PayPal system, login to your PayPal account, click 'Profile' in the top right, then select "My Selling Tools". Select "Update" next to "PayPal Buttons" and then click on Create New Button on the right side. The button builder is really a simple tool and will provide you with a complete HTML form to paste into your site's source.
It turns out that what I wanted is the Express Checkout:
Getting Started with Express Checkout

Pay event fee with paypal and allow guests

I have been hunting around developer.paypal.com for a couple of days now and have the gist of what I need. But I am still looking on the best way to accomplish my task.
What I need is a way for people to pay a fee for an event from my website. I would prefer to allow Guest Checkout as not all attendees will likely have a paypal account yet. But what I would really like is for the paypal website to handle all of checkout. In ebay, you see the total, a small summary and you pay for it right there. I have looked at express checkout, and it wants to return the user to my website to finalize everything.
So in short:
Allow guest checkout
Show payment total on Paypal webpage
Allow payment to be finalized and 'Captured' from PayPal's website, only coming back to my page to say Thanks.
And if possible, not require an address of the attendee
Can this be done?
I have long used StackOverflow for answers, but I am having a hard time finding this answer (mainly because I don't know exactly what I am looking for).
Thanks in advance
You are describing "standard", and the HTML button integration will be much easier than Express Checkout.
Express Checkout is the most robust API to use. The "return" to your site is a good thing, to give the customer the ability to click a final "Place Order" button. But you can also have this triggered automatically on return -- just run DoExpressCheckout without user interaction and display a thank you / confirmation message. If you are going to run DoEC w/o interaction, your initial redirect to PayPal.com should have &useraction=commit appended to the URL. Then, the final button at PayPal.com will say "Pay Now" instead of the default "Continue"
To allow guest checkout with EC, pass SOLUTIONTYPE=Sole in the initial SetEC call. Note that when customers load a PayPal.com checkout page, it checks their browser cookies to see if they have a PayPal email address stored. If they have one stored in the browser, the top "Log in to PayPal" section will be expanded. If they do not have an address stored -- generally meaning this is a brand new computer or they've never used a PayPal account to check out on this one before -- then the bottom guest checkout section will be expanded.
To not require an address, pass NOSHIPPING=1.

PHP Paypal Verification

So I'm new working with paypal, the problem I have is that I don't really know where to start, this is what I have to do: My client wants to give lessons, so he customers will order lessons, and they have to specify a date and a time, and if it's available he can make the payment, what is the easiest way to do it?
Assuming the customer is logged in, all I need to do is once the payment has been sent accomodate the lesson into the database, can I do that with just paypal "Pay Now" buttons? Or do I need other library?
All I know is that paypal "Pay Now" button can redirect you to a "success" url but that's it.
What should I use for this? Is there a library or something?
You need to go through this documentation to make your life easier !
PHP PayPal API

Categories