CakePHP Component for Payone-API Access
Payone is a german payment system with several product options and clearings. This Component started by implementing the Payone API just from scratch using curl. Thus it doesn’t feature the whole API yet. You should be able to process checkouts on creditcards for both the “Shop” and “Access” based solutions.
The component itself can be obtained from git git://github.com/mashpie/PayoneComponent.git. Checkout/clone it and move the files to the appropriate directories inside your cake app. Basic usage examples are included as docblock in the code itself. To use this component you’ll have to sign up with Payone and setup the config file accordingly.
Usage in “shop” mode
// 1) set CC $this->Payone->setCC( '4111111111111111', 'V', 1002, // for 2010-02 '123' ); // 2) add a person as address $this->Payone->setPerson(array( 'company' => 'My Company', 'firstname' => 'Marcus', 'lastname' => 'Spiegel' 'street' => 'Some Street 20a' 'country' => 'DE', 'language' => 'en', 'zip' => '10123', 'city' => 'Berlin', 'email' => <enter E-Mail here>, )); // 3) setup the invoice $this->Payone->setInvoice('RE-0001'); // 4) add an article $this->Payone->addArticle($articleNr, $singleprice, $articleDescription, $amount, $vat); // 5) authorize the payment, which processes the payment on success. Returns error on failure $this->Payone->authorization('RE-0001', $overallprice, $currency, $sometext, 'cc');
Usage in “access” mode
// 1) set CC $this->Payone->setCC( '4111111111111111', 'V', 1002, // for 2010-02 '123' ); // 2) add a person as address $this->Payone->setPerson(array( 'company' => 'My Company', 'firstname' => 'Marcus', 'lastname' => 'Spiegel' 'street' => 'Some Street 20a' 'country' => 'DE', 'language' => 'en', 'zip' => '10123', 'city' => 'Berlin', 'email' => <enter E-Mail here>, )); // 3) setup the product $this->Payone->setProduct(<PRODUCTID>); // 4) $this->Payone->createaccess(<PORTALID>, 'RE-0001');
To handle recurring payment workflows in different controllers, be advised to setup another PaymentComponent handling these instead of invoking payone methods directly from inside a controller.
Feedback strongly appreciated!




No Comments on "CakePHP Component for Payone-API Access"