Menu

SafetyPay

Note: To learn about the features of SafetyPay, there's an overviewhere

How to integrate SafetyPay payments:

Direct payment request

For SafetyPay payments, the <shopperEmailAddress> is mandatory:

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
  <submit>
    <order orderCode="YOUR_ORDER_CODE"> <!--Use a unique order code each time-->
      <description>test order</description>
      <amount value="1000" currencyCode="EUR" exponent="2"/>
      <orderContent>
      </orderContent>
      <paymentDetails>
        <SAFETYPAY-SSL shopperCountryCode="AT">
          <successURL>http://www.worldpay.com/successURL</successURL>
          <cancelURL>http://www.worldpay.com/cancelURL</cancelURL>
          <pendingURL>http://www.worldpay.com/pendingURL</pendingURL>
        </SAFETYPAY-SSL>
      </paymentDetails>
      <shopper>
        <shopperEmailAddress>shopper@worldpay.com</shopperEmailAddress><!--Mandatory-->
      </shopper>
    </order>
  </submit>
</paymentService>

Hosted payment request

In this example the merchant specifies that SafetyPay is the only payment method on offer. The following append string achieves this:

&country=AT&preferredPaymentMethod=SAFETYPAY-SSL

Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay/DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="YOUR_MERCHANT_CODE">
  <submit>
    <order orderCode="YOUR_ORDER_CODE" installationId="1234567"><!--Use a unique order code each time. Contact Worldpay if you haven't got an installationID-->
      <description>Test order</description>
      <amount value="100" currencyCode="EUR" exponent="2" />
    <orderContent>
      <![CDATA[ ]]>
    </orderContent>
      <paymentMethodMask>
        <include code="ALL" />
      </paymentMethodMask>
      <shopper>
        <shopperEmailAddress>shopper@worldpay.com</shopperEmailAddress>
      </shopper>
    </order>
  </submit>
</paymentService

Payment outcomes

Successful

Shopper pays
Event 1:Shopper successfully completes a delayed payment for USD 4.00.
Behaviour:The shopper completes their online journey and selects a post-pay method to complete the transaction in cash over the counter at their local bank.
URL:PENDING
URL Example:https://secure.worldpay.com/sc1/jsp/shopper/PendingView.jsp?orderKey=ADMINCODE^MERCHANTCODE^Example_SafetyPay_Order
Payment Status:The payment status changes to AUTHORISED.
Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
  <notify>
    <orderStatusEvent orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
      <payment>
        <paymentMethod>SAFETYPAY-SSL</paymentMethod>
        <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        <lastEvent>AUTHORISED</lastEvent>
        <balance accountType="IN_PROCESS_AUTHORISED">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </balance>
       <riskScore value="21"/>
      </payment>
      <journal journalType="AUTHORISED">
        <bookingDate>
          <date dayOfMonth="15" month="08" year="2013"/>
        </bookingDate>
        <accountTx accountType="IN_PROCESS_AUTHORISED" batchId="26">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </accountTx>
      </journal>
    </orderStatusEvent>
  </notify>
</paymentService>
Payment captured
Event 2:The Payment is captured in WPG.
Behaviour:The automatic capture job runs in WPG to automatically capture the payment.
URL:No URL is returned to the shopper as the shopper journey is already complete.
URL Example:N/A
Payment Status:The payment status changes to CAPTURED.
Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
  <notify>
    <orderStatusEvent orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
      <payment>
        <paymentMethod>SAFETYPAY-SSL</paymentMethod>
        <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        <lastEvent>CAPTURED</lastEvent>
        <balance accountType="IN_PROCESS_CAPTURED">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </balance>
        <riskScore value="21"/>
      </payment>
      <journal journalType="CAPTURED">
        <bookingDate>
          <date dayOfMonth="15" month="08" year="2013"/>
        </bookingDate>
        <accountTx accountType="IN_PROCESS_AUTHORISED" batchId="49">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="debit"/>
       </accountTx>
        <accountTx accountType="IN_PROCESS_CAPTURED" batchId="61">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </accountTx>
      </journal>
    </orderStatusEvent>
  </notify>
</paymentService>
Payment settled
Event 3:The payment is settled internally in WPG
Behaviour:The payment is successfully settled to the merchant’s WorldPay account.
URL:No URL is returned to the shopper as the shopper journey is already complete.
URL Example:N/A
Payment Status:The payment status changes to SETTLED.

Cancellation

There is no way to cancel a SafetyPay transaction.

Shopper closes browser
Event:Shopper closes the browser before payment process is complete.
Behaviour:With no cancel button, a shopper must close the browser to cancel a payment.
URL:No URL is returned to the shopper.
URL Example:N/A
Payment Status:The payment remains at SHOPPER_REDIRECTED
Notification Example:No notification is generated.

Invalid data entry

Shopper authentication takes place at the shopper’s respective bank. The only data entry required on the SafetyPay pages is for Brazilian shoppers, who are required to provide a valid CPF (Cadastro de Passoas Fisicas). The CPF is an identification number allocated by the Brazilian revenue agency, the Receita Federal.

Invalid CPF
Event 1:A Brazilian shopper provides an invalid CPF on the SafetyPay website.
Behaviour:The credentials are validated on the SafetyPay website. An error message appears to state that the CPF entered is invalid. The shopper remains on the SafetyPay website until the shopper enters a valid CPF.
URL:No URL is returned as the shopper does not leave the SafetyPay website.
URL Example:N/A
Payment Status:The payment status remains at SHOPPER_REDIRECTED
Notification Example:No notification is generated.
Insufficient funds
Event 2:The shopper has insufficient funds in their bank account.
Behaviour:The shopper is unable to complete the payment.
URL:No URL is returned as the shopper has already left the SafetyPay website and uses their online bank account.
URL Example:N/A
Payment Status:The payment status remains at SHOPPER_REDIRECTED.
Notification Example:No notification is generated.

Time out

Time out
Event:The shopper does not complete the payment within the allocated timeout period.
Behaviour:The shopper cannot complete the transaction and must start a new payment.
URL:No URL is returned as the shopper does not leave the SafetyPay website.
URL Example:N/A
Payment Status:The payment status remains at SHOPPER_REDIRECTED.
Notification Example:No notification is generated.

Exception conditions

Error with PSP
Event 1:The payment cannot be processed due to technical issues at the Payment Service Provider (PSP)
Behaviour:pendingURL with status=ERROR is returned. This scenario occurs in exceptional circumstances where the payment cannot be processed for technical reasons.
URL:PENDING (ERROR)
URL Example:http://www.worldpay.com/pendingURL?orderKey=ADMINCODE^MERCHANTCODE^ Example_SafetyPay_Order&status=ERROR
Payment Status:The payment status remains at SHOPPER_REDIRECTED.
Notification Example:No notification is generated.
Authorisation + 5 seconds
Event 2:Worldpay receives the asynchronous authorisation from SafetyPay more than 5 seconds after the shopper has completed their journey.
Behaviour:The system returns a pendingURL with an OPEN status.
URL:pendingURL
URL Example:http://www.worldpay.com/?pending&orderKey=ADMINCODE^MERCHANTCODE^Example_SafetyPay_Order&status=OPEN
Payment Status:The payment status changes to AUTHORISED.
Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
  <notify>
    <orderStatusEvent orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
      <payment>
        <paymentMethod>SAFETYPAY-SSL</paymentMethod>
        <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        <lastEvent>AUTHORISED</lastEvent>
        <balance accountType="IN_PROCESS_AUTHORISED">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </balance>
        <riskScore value="21"/>
      </payment>
      <journal journalType="AUTHORISED">
        <bookingDate>
          <date dayOfMonth="15" month="08" year="2013"/>
        </bookingDate>
        <accountTx accountType="IN_PROCESS_AUTHORISED" batchId="26">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        </accountTx>
      </journal>
    </orderStatusEvent>
  </notify>
</paymentService>
Invalid amount
Event 3:The Merchant submits a payment that is either above the maximum or below the minimum transaction amount for the SafetyPay payment method.
Behaviour:pendingURL with status=ERROR is returned.
URL:pendingURL
URL Example:http://www.worldpay.com/?pendingURL&orderKey=MERCHANTCODE^MERCHANTCODE^Example_SafetyPay_Order&status=ERROR
Payment Status:The payment status remains at SHOPPER_REDIRECTED
Notification Example:No notification is generated.

Refunds

Refund requested
Event 1:The merchant requests a refund of the payment in the Merchant Interface (MAI).
Behaviour:The merchant requests a direct refund of a settled payment in the MAI.
URL:PENDING (ERROR)
URL Example:http://www.worldpay.com/pendingURL?orderKey=ADMINCODE^MERCHANTCODE^ Example_SafetyPay_Order&status=ERROR
Payment Status:The payment status is set to SENT_FOR_REFUND.
Copied!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
  <notify>
    <orderStatusEvent orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
      <payment>
        <paymentMethod>SAFETYPAY-SSL</paymentMethod>
        <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="credit"/>
        <lastEvent>SENT_FOR_REFUND</lastEvent>
        <balance accountType="SETTLED_BIBIT_COMMISSION">
          <amount value="6" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
        </balance>
        <balance accountType="SETTLED_BIBIT_NET">
          <amount value="247" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
        </balance>
        <balance accountType="IN_PROCESS_CAPTURED">
          <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="debit"/>
       </balance>
        <riskScore value="21"/>
      </payment>
      <journal journalType="SENT_FOR_REFUND">
        <bookingDate>
          <date dayOfMonth="28" month="08" year="2013"/>
        </bookingDate>
       <accountTx accountType="IN_PROCESS_CAPTURED" batchId="67">
         <amount value="400" currencyCode="USD" exponent="2" debitCreditIndicator="debit"/>
       </accountTx>
      </journal>
    </orderStatusEvent>
  </notify>
</paymentService>
Refund sent
Event 2:The requested refund is successfully sent to the shopper's bank.
Behaviour:WPG receives confirmation that the payment has been successfully sent to the shopper's wallet.
URL:N/A
URL Example:N/A
Payment Status:The payment status is set to REFUNDED.
Refund fails
Event 3:The refund fails (e.g. because the shopper has given the wrong bank details).
Behaviour:WPG receives confirmation that the payment has been unsuccessful and has not arrived in the shopper's wallet.
URL:N/A
URL Example:N/A
Payment Status:The payment status is set to REFUND_FAILED.