PAYMENT
-
Prepare Checkout-Page
First, add the payment method to your payment method selection page.
You may get the Icon from
GET https://asia.vrpy.de/processing-api/v1/icons/<BRAND>
-
Send initial payment
After shopper choosed the payment method ans click “buy” in the checkout page, send the initial payment request.
POST https://asia.vrpy.de/processing-api/v1/payments \
-d "amount=92.12" \
-d "currency=EUR" \
-d "paymentBrand=ALIPAY" \
-d "paymentType=DB" \
-d "merchantTransactionId=ORDER123" \
-d "shopperResultUrl=https://docs.oppwa.com/tutorials/server-to-server" \
-H "Authorization: Bearer OGE4Mjk0MTc0YjdlY2IyODAxNGI5Njk5MjIwMDE1Y2N8c3k2S0pzVDg="
-
Redirect the Shopper
The next step is to redirect the shopper. To do this you must parse the redirect object, that contains a url.
{
"id":"6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result":{
"code":"000.200.000",
"description":"transaction pending"
},
"redirect":{
"url":"https://asia.vrpy.de/redirects/6ba7b810-9dad-11d1-80b4-00c04fd430c8"
}
}
- Get the payment status
Once the payment has been processed, the customer is redirected to shopperResultUrl along with a GET parameter resourcePath.
To get the status of the payment, merchant should make a GET request including authentication header.
GET "https://asia.vrpy.de/payments/6ba7b810-9dad-11d1-80b4-00c04fd430c8"
REFUND
-
Send refund
A refund is performed against a previous payment, referencing its payment.id by sending a POST request over HTTPS to the /payments/{id} endpoint. A refund can be performed against debit (DB) payment type. Where supported, the amount field can be used to process a partial or full amount.
POST https://asia.vrpy.de/v1/payments/6ba7b810-9dad-11d1-80b4-00c04fd430c8 \
-d "amount=92.12" \
-d "currency=EUR" \
-d "paymentType=RF" \
-H "Authorization: Bearer OGE4Mjk0MTc0YjdlY2IyODAxNGI5Njk5MjIwMDE1Y2N8c3k2S0pzVDg="
Merchant will get a syncron response:
{
"id":"5945c961-e74d-478f-8afe-da53cf4189e3",
"referencedId":"6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result":{
"code":"000.000.000",
"description":"transaction successful"
}