Jump to content

PayWhirlAPI


psy
 Share

Recommended Posts

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/ 

  • Like 8
Link to comment
Share on other sites

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);

 

Link to comment
Share on other sites

  • 3 months later...

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 ?

Link to comment
Share on other sites

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:

1011520336_Screenshot2018-05-1406_59_33.thumb.png.4404793cfde8d010c052ceb0650d2bd7.png

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

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...