Hosted Payment Window

Du er her:
Anslået læsetid: 3 min

By using Yourpays Hosted Payment Window you will not be met by difficult card compliance requirements, as Yourpay makes sure all data is handled and stored safely.

Your merchants will see our standardised Payment Window in relation to the transaction flow.
After the payment has been completed the consumer returns to the defined accept URL.

We will send an IPN (Instant Payment Notification) to the defined callback URL.

To get started with our Hosted Payment Window, take a look at our code example.

TIP You can open the file with notepad, if you do not have an editor for viewing source code.

In the example is a few php variables that we need to set.

First is $MerchantNumber in which you input your Yourpay merchantid.

Next we have $accepturl which as the name suggests is the url we return the customer to when the payment is processed, normally a “thank you” page.

$callbackurl is the url of the IPN listener page, this is where we send all transaction related event notifications to. When customers pay for goods or services, Yourpay sends a secure FORM POST containing payment information (IPN messages) to the URL. The IPN listener page detects and processes IPN messages using the merchant backend processes. The listener page contains a script or program which waits for the messages, validates them and passes them to various backend applications for processing.

$time should contain a PHP timestamp that indicates the time of the transaction.

$amount is the amount in lowest currency. 100 = 1 EUR, DKK, SEK etc.

$currencycode is the currency number of your desired currency. For instance 978 is the number for the Euro. For a complete list of currency numbers check here.

$orderid in here you can pass the order id from your shop platform to help you identify a customers payment.

$ccrg is set to 1 if you want to save the customers credit card information for later rebilling, otherwise set it to 0. Note that if you enable this you need to save the ccrg id from the response, this is what we use to rebill a customer on.

$language should contain the language code of the payment window. For instance for danish it’s “da-dk”. For a full list look here.

$comments can contain additional comments for the transaction.

$ct is a flag defining if the customer should pay the transaction fee. This can have two values “on” & “off”. If it’s set to “on”, the fee of the transaction will be added on top of the amount to be paid by the customer. For example if you bought a product for 1 EUR, the fee is added to this price in the payment window so it becomes 1.02 EUR.

$autocapture can have two values “yes” & “no”. If the value is “yes” the payment is captured automaticly after the payment is processed.

If you run the code example you get to a page with a link to open the payment window. The payment window might look similar to this:

test_payment_window.PNG

NOTE: This is our danish test window. If you provide a valid production merchantid you will get the appropriate payment window.

When you complete the payment you are then redirected to the specified accept URL along with a response from the payment window.

The response contains the following:

uxtime: A unix timestamp of the moment the Callback was created.
MerchantNumber: The merchantid which the transaction is processed for.
tchecksum: SHA1 encode of PaymentID + Integrationkey.
checksum: SHA1 encode of PaymentID + Integrationkey.
orderid: The order id provided.
ShopPlatform: The platform from which the order is made.
amount: Amount reserved on the customers creditcard. Note: 100 = 1 EUR.
split: Always 0.
date: The date of the transaction note its in the format “YYYY-MM-DD”
cvc: The CVC ID of the credit card. Always empty.
expmonth: Expiration month of the credit card.
expyear: Expiration year of the credit card.
tcardno: Credit card number. We do not expose the entire number.
time: Unix timestamp that indicates the time of the transaction.
cardid: Our id for the card type used, VISA, mastercard etc.
currency: The currency number for the currency of the transaction.

NOTE: If ccrg is set to 1, the ccrg id can also be found in the response.