public DoNonReferencedCredit ( |
||
$doNonReferencedCreditReq | ||
$apiCredential | mixed | - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically |
리턴 |
public function DoNonReferencedCredit($doNonReferencedCreditReq, $apiCredential = null)
{
$apiContext = new PPApiContext($this->config);
$handlers = array(new PPMerchantServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
$this->setStandardParams($doNonReferencedCreditReq->DoNonReferencedCreditRequest);
$ret = new DoNonReferencedCreditResponseType();
$resp = $this->call('PayPalAPIAA', 'DoNonReferencedCredit', $doNonReferencedCreditReq, $apiContext, $handlers);
$ret->init(PPUtils::xmlToArray($resp));
return $ret;
}
$doNonRefCreditRequestDetails->Comment = $_REQUEST['comment']; $doNonRefCreditRequestDetails->NetAmount = $itemAmount; $doNonRefCreditRequestDetails->ShippingAmount = $shippingAmount; $doNonRefCreditRequestDetails->TaxAmount = $taxAmount; $doNonRefCreditRequestDetails->Amount = $totalamount; $doNonRefCreditRequest = new DoNonReferencedCreditRequestType(); $doNonRefCreditRequest->DoNonReferencedCreditRequestDetails = $doNonRefCreditRequestDetails; $doNonRefCreditReq = new DoNonReferencedCreditReq(); $doNonRefCreditReq->DoNonReferencedCreditRequest = $doNonRefCreditRequest; /* * ## Creating service wrapper object Creating service wrapper object to make API call and loading Configuration::getAcctAndConfig() returns array that contains credential and config parameters */ $paypalService = new PayPalAPIInterfaceServiceService(Configuration::getAcctAndConfig()); try { /* wrap API method calls on the service object with a try catch */ $doNonRefCreditResponse = $paypalService->DoNonReferencedCredit($doNonRefCreditReq); } catch (Exception $ex) { include_once "../Error.php"; exit; } if (isset($doNonRefCreditResponse)) { echo "<table>"; echo "<tr><td>Ack :</td><td><div id='Ack'>{$doNonRefCreditResponse->Ack}</div> </td></tr>"; echo "</table>"; echo "<pre>"; print_r($doNonRefCreditResponse); echo "</pre>"; } require_once '../Response.php';