I've got a problem integrating PayPal Express Checkout. I want to disable the possibility to add a note to the buyer during the checkout process.
I'm using the PHP SOAP SDK (merchant-php-1.1.93_0.zip).
service.EndPoint targets to https://api.sandbox.paypal.com/2.0/.
In the first step of the order, where I make the SetExpressCheckout.. call I set the following value:
$SetECReqDetails->AllowNote = 0;
$SetEcReqDetails is the instance of \SetExpressCheckoutRequestDetailsType. But the customer is still able the enter a note at the PayPal site.
You're setting AllowNote to 0, not "0".
var_dump(0 == null) //outputs: boolean true
Code in the PayPalAPIInterfaceService, line 2436, has the following:
if($this->AllowNote != null) {
//prop is not a collection
//prop not complex
//prop is not value
So basically, you are not defining AllowNote.
I have verified that with the SDK you are using, currently offered on x.com for EC, your code does not work, and the following does work:
$setECReqDetails->AllowNote = "0";
Related
I'm using PayPal and want to add the payment method SEPA on my current website.
Here are some examples I have followed:
https://developer.paypal.com/docs/checkout/integration-features/standalone-buttons/#funding-sources
https://demo.paypal.com/de/demo/go_platform/pcRestServerV2/paymentOptions
So basically I'm not getting SEPA button as displayed here on above 2nd link.
Here is my code that helps you to identify what I'm doing wrong.
var FUNDING_SOURCES = [
paypal.FUNDING.PAYPAL,
paypal.FUNDING.VENMO,
paypal.FUNDING.CREDIT,
paypal.FUNDING.CARD,
paypal.FUNDING.SEPA,
];
FUNDING_SOURCES.forEach(function(fundingSource) {
// Initialize the buttons
var button = paypal.Buttons({
fundingSource: fundingSource
});
// Check if the button is eligible
if (button.isEligible()) {
// Render the standalone button for that funding source
button.render('#paypalCheckoutContainer');
}
});
Is there a reason you are checking for and rendering particular funding sources? You can let PayPal handle that automatically instead of a forEach loop. Basically, use the simpler code at; https://developer.paypal.com/demo/checkout/#/pattern/client
If you are not located in a country that defaults to showing SEPA, add &buyer-country=DE to the SDK script query string line when testing in sandbox mode. Only do this for testing other countries in sandbox mode, it is not a valid parameter in live. The buyer's country will be auto detected in live.
Wonder if anyone have tried successfully the Paypal demo code`s ?
My self is trying to get the Express Checkout Flow into my custom php, and downloaded the NVP / SOAP Code Samples from https://demo.paypal.com/us/demo/download?capability=checkOutWithPaypal&lang=PHP
After input of my sandbox account details, it works very well, in-fact just as hoped. But (always a but), it seems that this setting from paypal_config.php do not work as it should be:
//Set this constant USERACTION_FLAG = true to skip review page
define("USERACTION_FLAG", false);
//Based on the USERACTION_FLAG assign the page
if(USERACTION_FLAG){
$page = 'return.php';
} else {
$page = 'review.php';
}
If you try to set that to true, when directing from Paypal, you just comes to an white page.
Anyone got this to work as it should do?
Since its an express checkout, there shouldt be needed for another "review" page, just hit Pay, and done!
Tried to locate all functions in the files, but the $page string is not anywhere to be found else than config file.
Thanks for all answers :)
I am trying to create a paypal payment page, but for some reason when I try to add a custom web profile to the payment the option of checking out as a guest suddenly disappears.
First I am creating the web profile this way:
$flowConfig = new FlowConfig();
$flowConfig
->setLandingPageType("billing")
->setBankTxnPendingUrl("...");
$presentation = new Presentation();
$presentation
->setLogoImage("...")
->setBrandName("...")
->setLocaleCode("...");
$inputFields = new InputFields();
$inputFields
->setNoShipping(1)
->setAddressOverride(0);
$webProfile = new WebProfile();
$webProfile->setName("PROFILE" . uniqid())
->setFlowConfig($flowConfig)
->setPresentation($presentation)
->setInputFields($inputFields);
$request = clone $webProfile;
try {
$createProfileResponse = $webProfile->create($apiContext);
} catch (PayPal\Exception\PayPalConnectionException $ex) {
...
}
$profileId = $createProfileResponse->getId();
Then, I have updated the payment code in this way
$paypalPayment = new PayPalPayment();
$paypalPayment->setIntent("sale");
$paypalPayment->setPayer($payer);
$paypalPayment->setRedirectUrls($redirectUrls);
$paypalPayment->setTransactions(array($transaction));
$paypalPayment->setExperienceProfileId($profileId);
The weird thing is that if I comment the last line I can perform payments as a guest without any issue. If, instead, I leave it this way, I get the customized page but the "Check out as a guest" button is replaced by "Create an account".
Do I really have to choose between having a customized checkout page and the possibility to perform payments without creating paypal accounts? Or am I missing something? I didn't find anything related to this issue in the documentation nor here in stackoverflow, and it seems at least strange!
Thank you
Are you using Express Checkout? It looks like recurring payments without a PayPal account are only compatible with Website Payments Pro accounts.
You can still create recurring payments with EC but they will need a PayPal account to accept them, no guest checkout allowed by the looks of it.
https://www.paypal-community.com/t5/Merchant-services-Archive/How-to-accept-recurring-payments-from-buyers-who-don-t-have-a/td-p/178232
Im trying to support the checkout of ZAR (South African Rand).
So far i have enabled $, this enables the paypal module however the conversion isn't being completed.
The site simply checkout to the value. Eg: R1500.00 = $1500.00 when checking out through paypal.
What is the correct way to do the currency conversion using the built in convertor?
Ok found the solution:
Taken from Opencart Forum by user Qphoria
Q: How can I use paypal if my currency isn't supported?
Q: How can I use a payment gateway that doesn't support my currency?
Q: Paypal doesn't support my currency?
A:
You are limited to what the payment gateway supports. However, you can add code to auto-convert your currency to the current exchange rate of a supported currency fairly easy.
(v1.5.x)
1. EDIT: catalog/controller/payment/.php
FIND (FIRST INSTANCE ONLY):
Code: Select all
$order_info = $this->model_checkout_order->getOrder
AFTER, ADD (Replace USD with your choice of valid currency):
Code: Select all
$order_info['currency_code'] = 'USD';
Whatever currency you choose to use, be sure you have it in your list of currencies on your store in the Admin->System->Localisation->Currency page. It doesn't need to be enabled, just has to exist so that the conversion calculation can be done.
This will then auto convert the amount before it is sent to the gateway. The customer won't likely notice this.
They will see, for example, 1000 AED on the checkout page
But you will see $272.25 USD (based on the current conversion rate) in your paypal account.
Up til 1.5.1.3, Paypal Standard did this automatically
In 1.5.2, it was changed (not for the better) to simply disable itself from the list of payments if using an unsupported currency. So that will need special instruction and maybe should be changed back in the core.
For now:
1. EDIT: catalog/model/payment/pp_standard.php
FIND AND REMOVE:
Code: Select all
if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
$status = false;
}
EDIT: catalog/controller/payment/pp_standard.php
FIND (THE FIRST INSTANCE ONLY):
Code: Select all
$order_info = $this->model_checkout_order->getOrder
AFTER, ADD:
Code: Select all
$currencies = array('AUD','CAD','EUR','GBP','JPY','USD','NZD','CHF','HKD','SGD','SEK','DKK','PLN','NOK','HUF','CZK','ILS','MXN','MYR','BRL','PHP','TWD','THB','TRY');
if (!in_array(strtoupper($this->currency->getCode()), $currencies)) {
$order_info['currency_code'] = 'USD';
}
Change "USD" with your choice of supported currency.
for opencart 2 or 3
the first step is the same
EDIT: catalog/model/extension/payment/pp_standard.php
FIND AND REMOVE:
if (!in_array(strtoupper($this->currency->getCode()), $currencies)) { $status = false; }
the second step is
at catalog/controller/extension/payment/pp_standard.php
find
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
after it ,and
$order_info['currency_code'] = 'USD';
this solution will exchange all currencies to USD and then go to paypal.com to pay
I am working on shopping cart application in which there is an integration of PayPal and Google Checkout. All the code is working fine, but how do I know if the payment is done by Google or PayPal?
The response page for both Google Checkout and PayPal is the same.
After getting response I'm adding all the information to my database and removing items from the session, and then getting redirected to myindex page....
You could set a session variable or some sort of flag when executing the specific code for PayPal or Google.
Example:
payment() {
$vendor = selectedPayementVendor();
if($vendor == 'Google') {
$_SESSION['paymentVendor'] = 'google';
} elseif($vendor == 'PayPal') {
$_SESSION['paymentVendor'] = 'paypal';
} elseif ...
}