robmcvey / cakephp-paypal Goto Github PK
View Code? Open in Web Editor NEWCakePHP 2.0 plugin for PayPal Website Payment Pro
CakePHP 2.0 plugin for PayPal Website Payment Pro
i want to split Paypal payment into two accounts
Hi,
I integrated this plugin into my cakephp application.
The merchant's account is credited with the payment. However, the balance in the customer's personal account is not deducted.
I tried the above using the paypal sandbox.
Here is the snippet of the code I used:
$this->Paypal = new Paypal(
array(
'sandboxMode' => true,
'nvpUsername' => 'phpanika-facilitator_api1.gmail.com',
'nvpPassword' => 'xxxxxxxx',
'nvpSignature' => 'XXXXXXXXXXXXXXXXXXXX'
)
);
$payment = array(
'amount' => 2.00,
'card' => '4032 0311 6136 6470',
'type' => 'Visa',
'expiry' => array(
'M' => '10',
'Y' => '2019',
),
'cvv'=>'433',
'currency' => 'USD'
);
$this->Paypal->doDirectPayment($payment);
Please let me know whats the problem.
Is it possible to have multiple items in an Express Checkout order? Or would we just reference an internal Order ID with the order total for Express Checkout?
This is when deleting github issues would be helpful
Would be good to add method to store card in "vault" to allow recurring billing https://developer.paypal.com/docs/integration/direct/store-a-credit-card/
Hello,
Firstly great job!
Just wondering, do you have a copy of the required:
pear.php and PayPal/Error.php
As they are currently preventing me from getting it working?
To help whoever uses this till it is patched
paypal endpoint = 'https://api-3t.paypal.com/nvp';
paypal endpoint sandbox = 'https://api-3t.sandbox.paypal.com/nvp';
Would be great to add method for mass payments https://developer.paypal.com/docs/classic/mass-pay/integration-guide/MassPayUsingAPI/
Hello Author,
thanks for awesome plugin
i integrated in my cakephp project .. i got one issue when any user use credit card for payment ..paypal return success response and transaction id in doExpressCheckoutPayment method.. but how to track exactly amount credited in paypal account using transaction id..
some time happens order placed successfully but credit card amount not credited in paypal account..
Thanks in advance
There already exist a Rest API SDK PHP powered by Paypal, could be good idea wrap up that logic in our CakePHP an save some work, is't it?
Do you plan to port your module on 3.X soon?
I added NOTIFYURL parameter in your function formatDoDirectPaymentNvps() but paypal do not return to the mentioned url. This is in case of sandbox testing. Also how can I rely on session data, if computer get crashed after I made an request. Can we get parameters like sessionId passed from the website and notifyurl returns data in there.
Hi,
Just find out function storeCreditCard() isn't working with my test application:
if ($response->code == 200)
code to test what the response was like: \app\Controller\ApiController.php (line 120)
array(
'id' => 'CARD-7SF881509H6907000KO726SY',
'state' => 'ok',
'payer_id' => '186',
'type' => 'visa',
'number' => 'xxxxxxxxxxxx5242',
'expire_month' => '7',
'expire_year' => '2019',
'first_name' => 'Joe',
'last_name' => 'Shopper',
'valid_until' => '2017-07-10T00:00:00Z',
'create_time' => '2014-07-11T09:32:59Z',
'update_time' => '2014-07-11T09:32:59Z',
'links' => array(
(int) 0 => array(
'href' => 'https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-7SF881509H6907000KO726SY',
'rel' => 'self',
'method' => 'GET'
),
(int) 1 => array(
'href' => 'https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-7SF881509H6907000KO726SY',
'rel' => 'delete',
'method' => 'DELETE'
),
(int) 2 => array(
'href' => 'https://api.sandbox.paypal.com/v1/vault/credit-card/CARD-7SF881509H6907000KO726SY',
'rel' => 'patch',
'method' => 'PATCH'
)
)
)
*seems like there is no such field called "code" in the response JSON.
Hi there!
I just setup CakePHP Sniff + PHP CodeSniffer + Eclipse and realise that there are part of the code that doesn't follow the CakePHP CodeSniffer conventions that are the CakePHP Coding Standard you are following to organize your code.
Do you think we have to format the code following the CakePHP CodeSniffer?
The responseArray
for the storeCreditCard
method looks for a code
key, which doesn't appear to exist according to the API documentation: https://developer.paypal.com/docs/integration/direct/rest-vault-overview/#store-a-credit-card. Rather should the check be for an id
or perhaps a value for state
although I'm unsure what the other values besides "ok" might be. Also, the URL reference to the Paypal API is incorrect.
Let me know if you agree and I can submit a PR.
can you provide it for cakephp 3 i need urgently
When using express checkout, it works fine if a user pays using a PayPal account.
However, If the user is paying by manually entering the card in paypal - doExpressCheckoutPayment fails with internal error.
"This transaction couldn't be completed. Redirecting to payment gateway
Error: An Internal Error Has Occurred."
Is there a way to have better error reporting, or redirect user back to PayPal if required?
Hi,
I have a crowd funding website project built with cakephp framework and have to use paypal as payment gateway. This is my first project that involves payment transactions. I'm having a trouble using the adaptive payment. Can you give me a step-by-step instruction if that's possible? Because the instruction (https://github.com/robmcvey/cakephp-paypal#paypal-adaptive-payments) isn't all clear to me. Thanks.
In your readme, it refers to the SetExpressCheckout method returning a token. I can see that it in fact does in the $parsed['TOKEN'] variable, but this variable isnt set anywhere in the class so I can't grab it easily. That method just returns the full url to the paypal checkout.
Is there any way you can make this an easily accessible variable?
Thanks
I saw the for Express Checkout not support item quantity.
quantity always 1
What do you reckon about splitting up the code between the Classic API logic and the new Restful API logic to keep our more code clean and modular?
I just installed your plugin and i can not figure out whats going wrong. I am trying to make use of the "doDirectPayment"-method you implemented. I pass DKK as an argument for currency since it is the code for Danish Kroner. I get no errors and the payment goes through but on my sandbox account it seems to default to GBP no matter what currency i pass.
Hi, I am getting all of a sudden this error (expres checkout)
object(SocketException) {
[protected] _attributes => array()
[protected] _messageTemplate => ''
[protected] _responseHeaders => null
[protected] message => 'stream_socket_client() [function.stream-socket-client]: SSL operation failed with code 1. OpenSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
stream_socket_client() [function.stream-socket-client]: Failed to enable crypto
stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://api-3t.sandbox.paypal.com:443 (Unknown error)'
[protected] code => (int) 2
[protected] file => '/Users/rdeman/Documents/www/myproject/lib/Cake/Network/CakeSocket.php'
[protected] line => (int) 172
}
I am running
MAMP 3.5
PHP Version 5.6.10
OpenSSL/0.9.8zg
I had a non object error whilst implementing your $this->Paypal code. The resolution was that I had my component named as PayPal, so I just had to change from $this->Paypal to $this->PayPal. Noob mistake, but might help someone out
I had an actual ‘paypal redirect error’ (10486) while calling doExpressCheckoutPayment
. I noticed that $parsed
doesn’t have a TOKEN
key. So I used the $token
passed as an argument and it worked great.
throw new PaypalRedirectException($this->expressCheckoutUrl( $token ));
PS: Great plugin! Thanks a lot!
My client failed to deposit the money via Paypal. This message "You must pass a valid order array" was shown on the screen. Is this the Paypal problem? How can i fix this? Help me please.
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.