//create an array of fields to update, NOTE: id is required $name = $merchant->name; $updates = array('id' => $merchant->id, 'name' => $name . ' (UPDATED)'); //update the merchant $updated = GoCoin::updateMerchant($token, $updates); //show the updates echo '<h3 style="color:blue">Updated Merchant</h3>'; showObject($updated, FALSE); //reset the name $updates['name'] = $name; GoCoin::updateMerchant($token, $updates); } echo '<hr/>' . "\n"; echo '<h3 style="color:blue">All Merchant Payouts</h3>'; //get all payouts $payouts = GoCoin::getMerchantPayouts($token, MERCHANT_ID); var_dump($payouts); $DO_PAYOUT = FALSE; if ($DO_PAYOUT) { echo '<hr/>' . "\n"; echo '<h3 style="color:blue">Payout</h3>'; $payout = GoCoin::requestPayout($token, MERCHANT_ID, 1); var_dump($payout); showObject($payout); } //get all conversions echo '<hr/>' . "\n"; echo '<h3 style="color:blue">All Conversions</h3>'; $conversions = GoCoin::getCurrencyConversions($token, MERCHANT_ID); var_dump($conversions); if (!empty($conversions)) {
public function testGetMerchantPayouts() { if (!$this->doTest(__FUNCTION__)) { return; } //perform assertion $this->assertEquals(GoCoin::getApiMode(), 'test'); $this->assertNotEmpty(TOKEN); //get all payouts $payouts = GoCoin::getMerchantPayouts(TOKEN, MERCHANT_ID); //var_dump($payouts); $this->assertGreaterThanOrEqual(0, sizeof($payouts)); echo '[DEBUG]: SUCCESS: ' . sizeof($payouts) . "\n"; }