Skip to main content

Overview​

After the user completes payment, Oceanpayment sends an asynchronous payment notification to the noticeUrl provided in the merchant’s request. The notification contains the order number, payment status, payment time, and other transaction details for the merchant to verify and update the order status.

Before You Begin​

Note

For details about notification retries, retry intervals, and merchant response requirements, see Oceanpayment’s Notification Retry Mechanism and Specifications.

Payment Status Updates​

The same order may first receive a payment failure notification and later receive a payment success notification. When the success notification is received, merchants should treat it as the latest payment status. Update the order status based on the order number, payment ID, payment status, and payment time in the notification.

  1. Oceanpayment sends a payment result notification for the order to the merchant’s noticeUrl.
  2. After verifying the signature, the merchant updates the order to the latest status and proceeds with any follow-up actions, such as confirming the order or arranging shipment.

Parameters​

ParameterTypeDescriptionExample
notice_typestringNotification type
  • Fixed value: transaction
transaction
push_dateTimestringPush time
  • UTC+8 format: yyyy-MM-dd HH:mm:ss
2026-10-01 10:00:00
response_typestringCallback type
  • 0: browser return
  • 1: server async notification
1
accountstringOceanpayment account number995149
terminalstringOceanpayment terminal number99514901
signValuestringSecurity signature used to verify transaction integrity, SHA256 encryptede14328dc67b203de5048d999f3ccd054d1bad550a0821381ce508176329cb7ee
methodsstringPayment methodCredit Card
order_numberstringMerchant order numberNO123456789
card_countrystringCard issuing countryUS
order_currencystringTransaction currencyUSD
order_amountstringTransaction amount
  • Max 2 decimals,For example:1.00
0.1
order_notesstringOrder notes, returned as-isRemark
card_numberstringCard number
  • First 6 and last 4 digits
411111***1111
card_typestringCard typeVisa
payment_countrystringCustomer IP countryUS
payment_idstringOceanpayment unique payment ID20261030094706490119917358
quickpay_idstringQuickPay ID (UUID format)
  • Only for Subscripions/QuickPay payments
7c910aaf-4760-4467-bd23-d8157e01844b
payment_statusstringTransaction status
  • -1: pending
  • 0: failed
  • 1: success
1
payment_authTypestringTransaction type
  • 0: Sale
  • 1: PreAuth non-3D
  • 2: 3D non-PreAuth
  • 3: 3D PreAuth
0
payment_detailsstringPayment details
  • Can be displayed to the customer
80000:Transaction Approved
payment_solutionsstringSolutions for failed payment
  • Can be displayed to the customer
Contact the merchant website to confirm the payment result
payment_riskstringFailed risk rules in format
  • Rule=Score;Rule=Score;...
PriorChannel=0.0;
payment_amountstringActual paid amount by customer0.1
payment_exchangeRatestringExchange rate0.85358155
pay_barCodestringOrder barcode4500011583202610306638447730
auth_reasonstringPreAuth operation reasonConfirm authorization
order_operatorstringOperator handling pre-auth in backendOperator
auth_codestringCredit card authorization code
  • Returned for Credit Card, ApplePay, GooglePay only
1793325793759R9
pay_userIdstringCustomer IDUSER_9D7A2F6C1B84
card_cvvResultCodestringReturned CVV Code and Description01

Payment Status​

In the asynchronous notification parameters, payment_status indicates the payment result status. For details about each status, see the Payment Status documentation.

Response Code​

In the asynchronous notification parameters, payment_details contains the payment details for the transaction in the format [Code: Payment Details]. For code descriptions, see Payment Response Codes.

XML Response Example​

<?xml version="1.0" encoding="UTF-8"?>
<response>
<notice_type>transaction</notice_type>
<push_dateTime></push_dateTime>
<response_type>1</response_type>
<account>995149</account>
<terminal>99514901</terminal>
<signValue>0B1FAEDCD3DE9FB72F13A0DB80955479B00F2E6F7A4BF5C84A3403C1EAE489BE</signValue>
<methods>Credit Card</methods>
<order_number>NO12345678</order_number>
<card_type>Visa</card_type>
<card_country>US</card_country>
<order_currency>USD</order_currency>
<order_amount>1.99</order_amount>
<order_notes></order_notes>
<card_number>411111***1111</card_number>
<payment_country>CN</payment_country>
<payment_id>180808092746539010540</payment_id>
<payment_authType>0</payment_authType>
<payment_status>1</payment_status>
<payment_details>Successful test transaction</payment_details>
<payment_solutions></payment_solutions>
<payment_risk></payment_risk>
<payment_amount>1.00</payment_amount>
<payment_exchangeRate></payment_exchangeRate>
<pay_userId></pay_userId>
<pay_barCode>5b87b4528d3a66e4a59e51577960d552461c997a32c71e3c</pay_barCode>
<auth_reason></auth_reason>
<order_operator></order_operator>
</response>

Notification Parsing Example​

Notifications are sent to the noticeUrl provided in the transaction request.

// Get XML of push input stream
$xml_str = file_get_contents("php://input");
// Check whether the returned input stream is XML
if(xml_parser($xml_str)){
$xml = simplexml_load_string($xml_str);
// Assign the push parameters to $_REQUEST
$_REQUEST['response_type'] = (string)$xml->response_type;
$_REQUEST['account'] = (string)$xml->account;
$_REQUEST['terminal'] = (string)$xml->terminal;
$_REQUEST['payment_id'] = (string)$xml->payment_id;
$_REQUEST['order_number'] = (string)$xml->order_number;
$_REQUEST['order_currency'] = (string)$xml->order_currency;
$_REQUEST['order_amount']= (string)$xml->order_amount;
$_REQUEST['payment_status']= (string)$xml->payment_status;
$_REQUEST['payment_details'] = (string)$xml->payment_details;
$_REQUEST['signValue'] = (string)$xml->signValue;
$_REQUEST['order_notes'] = (string)$xml->order_notes;
$_REQUEST['card_number'] = (string)$xml->card_number;
$_REQUEST['payment_authType'] = (string)$xml->payment_authType;
$_REQUEST['payment_risk'] = (string)$xml->payment_risk;
$_REQUEST['methods'] = (string)$xml->methods;
$_REQUEST['payment_country'] = (string)$xml->payment_country;
$_REQUEST['payment_solutions'] = (string)$xml->payment_solutions;
}

// Check whether it is XML
function xml_parser($str){
$xml_parser = xml_parser_create();
if(!xml_parse($xml_parser,$str,true)){
xml_parser_free($xml_parser);
return false;
}else {
return true;
}
}

Signature Security Verification​

TypeSignature Structure
Paymentsaccount+terminal+order_number+order_currency+order_amount+order_notes+card_number+payment_id
+payment_authType+payment_status+payment_details+payment_risk+secureCode

Signature Verification Example​


$_REQUEST['signValue'] = (string)$xml->signValue;

// Get the local secureCode value
$secureCode = {secureCode};
$local_signValue = hash("sha256",$_REQUEST['account'].$_REQUEST['terminal'].$_REQUEST['order_number'].$_REQUEST['order_currency'].$_REQUEST['order_amount'].$_REQUEST['order_notes'].$_REQUEST['card_number'].$_REQUEST['payment_id'].$_REQUEST['payment_authType'].$_REQUEST['payment_status'].$_REQUEST['payment_details'].$_REQUEST['payment_risk'].$secureCode);
// Encrypted string validation
if (strtolower($local_signValue) == strtolower($_REQUEST['signValue'])) {
if ($_REQUEST['payment_status'] == 1) {
// Payment successful
}elseif($_REQUEST['payment_status'] == 0){
// Payment failed
}elseif($_REQUEST['payment_status'] == -1){
// Pending
if ($_REQUEST['payment_authType'] == 1){
// Pre-authorization pending
}else{
//Payment failed
}
}
}else{
// Validation failed
}
echo "receive-ok";
exit;