"; $customerPayment = $getInitResponse->readResponse->record;// $customerPayment = new CustomerPayment(); echo "total: " . $customerPayment->total . "
"; $paymentMethod = new RecordRef(); $paymentMethod->internalId = "5"; // Add Credit Card information $customerPayment->paymentMethod = $paymentMethod; $customerPayment->ccName = "Joe Jerry"; $customerPayment->ccNumber = "****************"; $expireDate = new DateTime("01/01/2015"); $customerPayment->ccExpireDate = $expireDate; $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