-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Hello team,
I am doing the migration to the new library and I am having dificulty with the refund.
This is the refund logic that I was using with the old library.
`
use com\realexpayments\remote\sdk\RealexClient;
use com\realexpayments\remote\sdk\domain\payment\PaymentRequest;
use com\realexpayments\remote\sdk\domain\payment\PaymentType;
use com\realexpayments\remote\sdk\http\HttpConfiguration;
use com\realexpayments\remote\sdk\RealexServerException;
$request = ( new PaymentRequest() )
->addType(PaymentType::PAYMENT_OUT)
->addMerchantId("merchant")
->addAccount( "account")
->addAmount(1900)
->addOrderId("order_id_goes_here")
->addCurrency("EUR")
->addPayerReference("payer_unique_id_goes_here")
->addPaymentMethod("card_ref_unique_id_goes_here")
->addRefundHash(sha1("refund_password"));
$httpConfiguration = new HttpConfiguration();
$httpConfiguration->setEndpoint("https://api.sandbox.realexpayments.com/epage-remote.cgi");
$client = new RealexClient("secret", $httpConfiguration);
try {
$paymentResponse = $client->send($request);
}catch (RealexServerException $e) {
echo $e->getMessage();
}
`
How do I convert this code to PHP-SDK library?
Thank you in advance.