craftcms / commerce-paypal Goto Github PK
View Code? Open in Web Editor NEWPayPal payment gateway for Craft Commerce.
Home Page: https://plugins.craftcms.com/commerce-paypal
License: MIT License
PayPal payment gateway for Craft Commerce.
Home Page: https://plugins.craftcms.com/commerce-paypal
License: MIT License
We are wondering if in the response object, after a successful transaction, the object contains the information currency_conversion.
with the object:
payout_currency_conversion
We are running a multi-currency e-commerce shop, but at the moment we are not getting enough information back in the response from PayPal payments (Mollie gateway is being used). We are missing the conversion rates of the multi currency payments.
If anybody has the answer that would be awesome.
See the below screenshot. PayPal Express datePaid
is always null, despite payment going through, and being marked as paid. I can confirm payment has been indeed received in PayPal.
Below is also an example order from the database.
Any ideas?
{
"data":
[
{
"billingAddressId": 7842,
"shippingAddressId": 7843,
"gatewayId": 2,
"customerId": 17802,
"id": 25592,
"orderStatusId": 1,
"number": "a72fbeff6773834aeb7a7c450d4580bb",
"couponCode": null,
"itemTotal": 5,
"totalPrice": 5,
"totalPaid": 5,
"email": "[email protected]",
"isCompleted": 1,
"dateOrdered": "2018-11-23 01:55:04",
"datePaid": null,
"currency": "AUD",
"paymentCurrency": "AUD",
"lastIp": "::1",
"orderLanguage": "en-AU",
"message": null,
"returnUrl": "/shop/customer/order?number=a72fbeff6773834aeb7a7c450d4580bb",
"cancelUrl": "/shop/checkout/payment",
"shippingMethodHandle": "metroDeliveryRegion",
"dateCreated": "2018-11-23 01:44:08",
"dateUpdated": "2018-11-23 01:55:07",
"uid": "4352ad82-4418-482b-b27e-de6e6670c426",
"paymentSourceId": null,
"paidStatus": "paid",
"reference": "a72fbef"
}
]
}
I'm not fully into omnipay so maybe I did something wrong. I installed the plugin and filled the settings, but I'm unable to make a payment. I'm not entirely sure how I'm supposed to fix the returnUrl in your JS or even if I'm supposed to use the JS there.
Returns an object with the property returnUrl
and this is something like
"https://example.dev/index.php?p=admin/actions/commerce/payments/complete-payment&commerceTransactionHash=38e9d950e911ca849435ee47d52bda8d&token=EC-00807207G21606545&PayerID=XXXXXX"
The issue is; this is not dealed as "action" request as per https://github.com/craftcms/cms/blob/develop/src/web/Request.php#L1264 the URL contains a "token" paramter so Craft won't accept it as an action request.
Is there a suggested work around for this? I could either change the token param or change that JS and use a custom one. I've tried to somehow route directly to the controller without an action param or include the route in my custom plugin but that does not seem to be clean
Hi there,
I created a payment controller to handle partial payments and am using tabs to present the 2 forms on the payment page so that customers can choose if they'd like to pay in full or make a deposit and pay the balance later.
But if I try to add PayPal as a payment option in each tab, it doesn't work as its only recognising/using the 1 form/button.
Is there a way to have 2 PayPal buttons on the 1 page?
Thanks for any guidance you can offer.
I have setup a charity website including a simple online store using Craft Commerce 2 and the PayPal Pro gateway.
With the upcoming European regulation changes, it means that all sites will need to support the PSD2 requirements and Strong Customer Authentication (SCA). The changes will be compulsory from 14th September 2019.
Are there any plans for the PayPal Pro element of this gateway to support the changes? In a PayPal email it suggested using a free authentication merchant plug-in from CardinalCommerce to activate 3D-Secure but I think that then needs to be integrated with the gateway.
In the meantime I can switch my client to PayPal Express to use a hosted payment form.
We have had a client say that either the shipping/billing address isn't being passed to PayPal Express when their customers choose this payment method.
Is there something I'm missing to pass this information over?
We've ticked on Should commerce send cart information to gateway when making transactions.
but this has made no difference.
They've said by not passing this information across to PayPal they don't qualify for PayPal Seller Protection
Is it possible to replace $
with jQuery
in paymentForm.js
After click the PayPal Express button, It errors with popup dialogue says "The total of the cart amounts do not much order amounts.".
I found that it occurs when I set order.paymentCurrency to different currency from the primary store currency, also enabled "Should commerce send cart information to gateway when making transactions." option in the gateway setting (Commerce Setting > Gateways > gateway:paypal express selected)).
If I disabled that option, I can make payment having no issue.
Hi there,
We're having trouble with the PayPal Express checkout and would appreciate any help, or if it's a bug, any fixes. :) The setup is as following:
PHP 7.0.30
Craft Pro 3.0.13.2
Craft Commerce 2.0.0-beta.6
PayPal for Craft Commerce 1.0.0
SSL enabled
tokenParam: [custom string]
PayPal Express Gateway Settings: Purchase + Test mode + Mark + Login (tried others too).
Using PayPal Sandbox account credentials
This is what happens: At checkout I choose PayPal express from the "native" twig gateway handler template that comes with commerce. After clicking, the expected popup appears and I pay with one of the sandbox accounts created, that also has more than enough funds. The popup closes and triggers a callback to actions/commerce/payments/complete-payment.
Query string parameters are: p, commerceTransactionHash, token, PayerID (which all look OK).
That callback then returns status 400 with following error:
{"error":"Es ist nicht möglich, Ihre Dateneingabe zu prüfen."}
Translated it means "It is not possible to check/verify your input".
I have also received the error 400 with "Uncaught Error: Request to post: failed with 400 error. Correlation id: unknown. {"error":"Es ist nicht möglich, Ihre Dateneingabe zu prüfen."}"
on the same callback.
(My browser and craft user account are in English, so I'm not sure why it returns German errors. Site locale is German and PayPal account is based in Switzerland - maybe that's why.)
Thank you for looking into this!
Kind regards,
Meinhard
The PayPal Rest documentation lists two URLs to complete a PayPal Rest request. A create and execute url.
I am assuming the execute url would be '/actions/commerce/payments/pay', but I not sure what the create payment url is. Would it be the Rest Controller in the commerce-paypal plugin? So something like: '/actions/commerce-paypal/rest/prepare-payment'?
Also, I haven't had time to add subscriptions yet (hopefully soon), but I am wondering if the PayPal Rest gateway will support subscriptions? Their documentation stated that they do support subscriptions, but the commerce gateway documentation stated the Stripe was the 'only first party gateway to support subscriptions'.
Please note: these questions are not urgent. Please answer at your convenience. Thank you in advance for any feedback.
The paymentForm model is returning errors when I do an Ajax submission to the Payments Controller in Commerce. I've tracked the issue to the rules in PayPalRestPaymentForm model class.
My understanding is that the token being set would modify the rule settings (similar to Stripe plugin payment model) so that the parent (CreditCardPaymentForm) rules would not apply. Basically, the token validates those attributes (firstName, lastName, etc).
Example Payment Form Object:
(
[cardReference] =>
[firstName] =>
[lastName] =>
[number] =>
[month] =>
[year] =>
[cvv] =>
[token] => EC-8M4794274U743332C
[expiry] =>
[threeDSecure] =>
[_errors:yii\base\Model:private] => Array
(
[firstName] => Array
(
[0] => First Name cannot be blank.
)
[lastName] => Array
(
[0] => Last Name cannot be blank.
)
[month] => Array
(
[0] => Month cannot be blank.
)
[year] => Array
(
[0] => Year cannot be blank.
)
[cvv] => Array
(
[0] => Cvv cannot be blank.
)
[number] => Array
(
[0] => Number cannot be blank.
)
)
Any plans to work with PayPal subscriptions anytime soon? Stripe don't operate in many countries, including mine. Thanks.
When using the PayPal Express payment gateway, the PayPal button generated by resources/js/paymentForm.js
has no means to customise the styling of the button itself (e.g. via the style:
prop).
While it's possible to work around this by making a non-vendor copy of the init code, I'm hesitant to do so in case changes are made to the underlying systems it's leaning on.
Apologies in advance if I've totally missed the option somewhere.
PayPal Plus is common Payment-Gateway-Option of PayPal in Germany. With PayPal Plus the customer is able to pick creditcart, SEPA, pay with a bill or his PayPal account.
Is it possibile to enable this "version" of paypal in the commerce-paypal-plugin? There is already a fork of the omnipay-paypal repo for supporting the paypal plus option: https://github.com/mikoweb/omnipay-paypal-plus
This would be an awesome feature for the german market, cause the most clients are a little scared of companies like stripe and they would love to use the services of a well know company like PayPal.
Wondering if it is at all possible to enable PayPals 'Pay in 3' option to this plugin?
Is this something that needs to be added to the plugin or is it simply the case of enabling something within your PayPal account?
Any info you could give on this would be appreciated!
I use the Paypal Gateway works all fine but the redirect from Paypal is this:
example.com/index.php/actions/commerce/payments/complete-payment?commerceTransactionHash=XXXXXXXXXXXXXXXXXXXXXXXXXXXX&token=EC-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I'm a bit confused where it comes from and how we can update it.
Any Ideas whats going wrong here? It's a bit important :/
We just received an email from PayPal about failing IPNs (the url referenced has a long list of Craft Commerce and PayPal tags/hashes and so forth, and redirects to a recent order in our system—edited for privacy);
Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing
https://askrembla.com/index.php?p=actions%2Fcommerce%2Fpayments%2Fcomplete-payment&commerceTransactionId=<ID>&commerceTransactionHash=<HASH>%0Ahttps%3A%2F%2Faskrembla.com%2Findex.php%3Fp%3Dactions%2Fcommerce%2Fpayments%2Fcomplete-payment&commerceTransactionId=39&commerceTransactionHash=<HASH>7%0Ahttps%3A%2F%2Faskrembla.com%2Findex.php%3Fp%3Dactions%2Fcommerce%2Fpayments%2Fcomplete-payment&commerceTransactionId=42&commerceTransactionHash=<HASH>
If you do not recognize this URL, you may be using a service provider that is using IPN on your behalf. Please contact your service provider with the above information. If this problem continues, IPNs may be disabled for your account.
Thank you for your prompt attention to this issue.
Paypal Express is deprecated as of 01.012017.
The suggested path is to update to PayPal Checkout (https://developer.paypal.com/docs/checkout/integrate/#)
I feel like I'm going mad here, but I can't figure out how to get my PayPal API details for PayPal Express and I'm not sure where to turn for support.
In my PayPal Express config I can only see values for "Live Account" and "AccessToken" - not API Username, etc. which is expected in Craft config: https://cl.ly/f7ba5faa01c9
Any ideas?
Have set up a checkout using Paypal Express using the instructions outlined.
However when attempt to check out with the paypal button loaded into the template I get the following response when in Test Mode:
Security header is not valid
This happens irrespective of whether method is set to Mark or Sole/solo (and also both login and billing). Is this expected behaviour?
I have this in my payment form:
<input type="hidden" name="cancelUrl" value="/cart/payment">
...this works with Commerce V1 and returns to:
https://mylivesite.com.au/cart/payment?token=EC-7XY47599960613715
If I cancel a payment on Commerce V2, however, it cancels back to my homepage, not the payment page:
https://dev.whatever.net.au/?token=EC-5RK943246T290434N
(I can see a reference to cancelUrl in commerce-omnipay, buty not in commerce-paypal)
Is there a tutorial or docs explaining how to implement this in commerce 2 ?
Composer says "Package craftcms/commerce-paypal is abandoned, you should avoid using it. Use craftcms/commerce-paypal-checkout instead."
But commerce-paypal-checkout doesn't contain support for Paypal Express, for example. Is this really abandoned?
I try to get PayPal Express running but have quite some difficulties. I use the default templates for testing and can get through the whole checkout and payment process, but then PayPal closes and in the console I see the following
http.js:114 Paypal Uncaught Error: Request to post http://xxx.local/index.php?p=actions/commerce/payments/complete-payment&commerceTransactionHash=xxx&token=xxx&PayerID=xxx failed with 400 error.
Correlation id: unknown
{"error": "Es ist nicht möglich, Ihre Dateneingabe zu prüfen."}
The error message can be translated to: It's not possible to check your data input.
In my Craft config, I changed the token name, as described here: https://github.com/craftcms/commerce-paypal
And also disabled CSRF.
Any ideas what the reason for this could be?
You know what would be really cool?
The ability to set the Test Mode automaticaly via environement config.
Something like this:
'dev' => [
'paypalTestMode' => true,
],
'production' => [
'paypalTestMode' => false,
]
Or maybe a listener who reacts to the craft dev mode config: 'devMode' => true,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.