Hi Again
this is what I have currently for creating payment.
I have got it to work once by manually entering the values of the required fields but it doesn’t seem to work with my variables
In the API log in splynx it looks like all my variables come through correctly but it is still giving an error.
Also now when I try to manually set all the variables in a test file I get error 500 but the payment goes into splynx anyway.
$PaymentsApiUrl = “admin/finance/payments”;
print “Create Payment\n”;
$result = $api->api_call_post($PaymentsApiUrl,
array(
‘customer_id’ => $CustomerId,
‘payment_type’ => ‘7’,
‘receipt_number’ => “8888890888”,
‘date’ => substr($date, 0, -9),
‘amount’ => $price,
‘transaction_id’ => $trans_id,
‘field_1’ => $trans_id,
‘field_2’ => $email,
‘field_3’ => ‘fdfsdf’,
‘field_4’ => ‘fsdfsfs’,
‘field_5’ => ‘dfsdfdvvs’,
));
print "Result: ";
if ($result) {
print “Ok!\n”;
print_r($api->response);
$PaymentId = $api->response[‘id’];
} else {
print “Fail! Error code: $api->response_code\n”;
print_r($api->response);
$PaymentId = false;
}
print “\n-------------------------------------------------\n”;