psy Posted January 24, 2018 Posted January 24, 2018 Seems I needed this at the same time as other ProcessWire devs. Timely! This module is simply a ProcessWire module wrapper for the PayWhirl API and being the initial release, may have a few unforeseen hiccoughs. Please be gentle with me when reporting any problems. As with all API's make certain your ducks are all lined up with the vendor first, in this case PayWhirl -https://app.paywhirl.com/ Download the module from GitHub at https://github.com/clipmagic/PayWhirlAPI Download the module from ProcessWire modules at http://modules.processwire.com/modules/pay-whirl-api/ 8
psy Posted January 24, 2018 Author Posted January 24, 2018 Example use: get a list of the logged-in user's subscriptions: <?php namespace ProcessWire; use PayWhirl; $payWhirl = $modules->get('PayWhirlAPI')->login(); $data = array('keyword' => $user->email); $userSubs = $payWhirl->getSubscriptions($payWhirl->getCustomers($data)[0]->id);
rareyush Posted May 5, 2018 Posted May 5, 2018 I am trying to use this module but when I try to use the above code, I am receiving an error Using processwire 3 Error: Uncaught Error: Cannot use object of type stdClass as array in C:\xampp\htdocs\Yush\wos\site\templates\test.php:7 Stack trace: #0 C:\xampp\htdocs\Yush\wos\wire\core\TemplateFile.php(287): require() #1 C:\xampp\htdocs\Yush\wos\wire\core\Wire.php(380): ProcessWire\TemplateFile->___render() #2 C:\xampp\htdocs\Yush\wos\wire\core\WireHooks.php(723): ProcessWire\Wire->_callMethod('___render', Array) #3 C:\xampp\htdocs\Yush\wos\wire\core\Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #4 C:\xampp\htdocs\Yush\wos\wire\modules\PageRender.module(514): ProcessWire\Wire->__call('render', Array) #5 C:\xampp\htdocs\Yush\wos\wire\core\Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #6 C:\xampp\htdocs\Yush\wos\wire\core\WireHooks.php(723): ProcessWire\Wire->_callMethod('___renderPage', Array) #7 C:\xampp\htdocs\Yush\wos\wire\core\Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #8 C:\xampp\ (line 7 of C:\xampp\htdocs\Yush\wos\site\templates\test.php) This error message was shown because: site is in debug mode. ($config->debug = true; => /site/config.php). Error has been logged. On 1/24/2018 at 2:12 PM, psy said: Seems I needed this at the same time as other ProcessWire devs. Timely! This module is simply a ProcessWire module wrapper for the PayWhirl API and being the initial release, may have a few unforeseen hiccoughs. Please be gentle with me when reporting any problems. As with all API's make certain your ducks are all lined up with the vendor first, in this case PayWhirl -https://app.paywhirl.com/ Download the module from GitHub at https://github.com/clipmagic/PayWhirlAPI Download the module from ProcessWire modules at http://modules.processwire.com/modules/pay-whirl-api/ is there any documentation or some tutorial how to use it exactly ?
psy Posted May 6, 2018 Author Posted May 6, 2018 @rareyush The module simply makes it easy to login in then use the PayWhirl API in ProcessWire. The documentation is at https://api.paywhirl.com/ Please paste your template code in here and I'll see if I can identify the cause. 1
WinnieB Posted May 6, 2018 Posted May 6, 2018 I don't use PayWhirl but am writing a PW module to wrap an external API so reading the code is very helpful, thanks! 1
rareyush Posted May 13, 2018 Posted May 13, 2018 On 5/6/2018 at 6:26 AM, psy said: @rareyush The module simply makes it easy to login in then use the PayWhirl API in ProcessWire. The documentation is at https://api.paywhirl.com/ Please paste your template code in here and I'll see if I can identify the cause. documentation help thanks
psy Posted May 13, 2018 Author Posted May 13, 2018 Hi @rareyush On 5/6/2018 at 10:56 AM, psy said: The documentation is at https://api.paywhirl.com/ As an example, to retrieve a list of customers: The data returned is an array of Std Class objects. The error message you're getting, without actually seeing your test.php template, indicates a problem in your code. In the PayWhirl example, to get the first name of the first Customer, you would need: echo $myobj[0]->first_name; To get a list of all Customer first names: foreach ($myobj as $one) { echo $one->first_name . "<br />"; } Note the '->' to get the data from an object, not an array. Hope this helps
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now