"; $customerPayment = $getInitResponse->readResponse->record; echo "total: " . $customerPayment->total . "
"; $paymentMethod = new RecordRef(); $paymentMethod->internalId = "1"; $customerPayment->paymentMethod = $paymentMethod; $customerPayment->applyList->apply[0]->amount = 50; $customerPayment->total = NULL; $customerPayment->applied = NULL; $customerPayment->unapplied = NULL; $customerPayment->balance = NULL; $customerPayment->pending = NULL; $customerPayment->applyList->apply[0]->total = NULL; $customerPayment->applyList->apply[0]->due = NULL; $customerPayment->applyList->apply[0]->disc = NULL; $addReq = new AddRequest(); $addReq->record = $customerPayment; $writeRes = $service->add($addReq); if ($writeRes->writeResponse->status->isSuccess) echo "Successful Payment
"; else { $writeResStatusDetails = $writeRes->writeResponse->status->statusDetail; foreach ($writeResStatusDetails as $writeResStatusDetail) { echo $writeResStatusDetail->type . ": "; echo $writeResStatusDetail->message . "
"; echo $writeResStatusDetail->code . "
"; } }} else { echo "Fail Initialization"; $statusDetails = $getInitResponse->readResponse->status->statusDetail; foreach ($statusDetails as $statusDetail) { echo $statusDetail->type . ": "; echo $statusDetail->message . "
"; echo $statusDetail->code . "
"; }}?>
No comments:
Post a Comment