Braintree Payment Gateway Yii Extension
15. July 2013 Blog, Personal Projects, Yii Extensions 21
My first extension I submitted to Yii’s Extension library. You can see the extension here: http://www.yiiframework.com/extension/braintreeapi/
I also have the code in a repo if anyone you are interested: https://bitbucket.org/pitchinnate/braintreeapi-yii-extension
Feel free to leave comments here and I’ll try to help fix any bugs you may encounter.
21 thoughts on “Braintree Payment Gateway Yii Extension”
Thanks, I’ll let you know if I have any issues.
I’m sort of a PHP noob, and I’m currently getting the following error when submitting a payment:
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
Any help would be greatly appreciated!
I’m assuming you are on PHP 5.5 is that correct? This is in Braintree’s API code. I will look to see if they have some updated files that will work with PHP 5.5.
Yeah they have updated their API code for PHP 5.5. I will work on updating the plugin to include the new files. In the meantime if you download https://www.braintreepayments.com/assets/client_libraries/php/braintree-php-2.22.2.tgz inside it there is a folder named ‘lib’ you should be able to delete the ‘lib’ folder out of the plugin and replace it with this new ‘lib’ folder and it should work for you.
I just replaced the ‘lib’ folder like I explained above and everything still seems to work. I will publish a new plugin sometime today.
awesome, thanks! sorry to bug you, i’ve been killing myself learning yii for this project and now i’m down to the last piece – payments.
I’m just digging into their api, but have you had any success with recurring payments, yet? Thanks for the work on this. Really helpful.
Never tried to use it in a production environment but have had success in their sandbox environment.
I can’t get the credit card info to pass through with a new customer, no matter what I try. I’m trying to create a new customer, along with their credit card, and the customer creates just fine, but no credit card info gets passed with it.
When I try to tweak the code to test it, I keep getting the error that there is no ‘creditCard’ key in the array. Any thoughts? Have you had success doing this?
I’ll setup a dev environment and give it a try.
Not sure if it helps, but here is the applicable error. I tried doing it where I create a customer, then in the next step add the credit card number, but as I figured, same error.
Undefined index: creditCard
You could create another scenario that does both at the same time. It would go in the BraintreeCCForm.php file basically it would be combining the customer() and creditcard() functions.
With this error, it was set to the creditcard scenario. I broke it up into 2 steps, create user then create credit card, since I couldn’t get it to do both at once. But as you can see, I was still having trouble with it with just the creditcard scenario.
Did you check your form id and the form id you are passing to the widget?
Hot damn, that was it. Just worked after changing the ID. Thanks for the help. I’ll probably be hitting you up more as I try to get subscriptions working in this. Hopefully I can muddle through this without bugging you, though!
Thanks for the help.
Not a problem glad I could help. Feel free to ask questions anytime I’ll help if I am able to.
I’ve been working with the great widget Nate has provided and I’ve made several adjustments to it in order to use the Braintree Partner API. Basically I set it up to have the ability to use different Braintree config values based on the type of transaction. I’ve always set something up in Iron.io to run scheduled/recurring payments, since using Braintree native recurring billing doesn’t allow you to take transaction fees off of Partner transactions. I’d be happy to share what I’ve got if you’re interested, just let me know. Cheers.
I’m waiting for recurring payments and extra notify email to user upon subscriber expried specific day , any good news from that? Thanks advanced for the work on this
I’m interested in creating a form to process sub-merchant on-boarding. Can you start me in the right direction for creating another form?