Documente Academic
Documente Profesional
Documente Cultură
v0.7
-1-
v0.7
-2-
Revision History
Version 0.1 0.2 0.3 0.4 Date 2011-03-02 2011-03-16 2011-03-18 2011-03-24 Revisions Initial document draft Added test plan section Added screenshots. Renamed 7-Pay ID to 7-Pay Reference. Added documentation on generating the token. Also added sample php code for getting the 7-Pay Reference. Added 3 new optional fields (transactionDescription - will be shown in the customer LCD screen and payment instruction page, receiptRemarks that is printed in the receipt, and email for notifying customers of 7-Pay transactions. Also added sample code for merchant web service implementation. 0.6 0.7 2011-04-26 2011-07-26 Modified branding to 7-CONNECT. Updated the instruction page screenshot to include the Email instructions to button. (2.1) Changed receipt remarks maximum limit to 660 characters and added an example. (2.1.2) Corrected URL of test environment. (2.1.4) Added a merchant ID parameter to the transaction inquiry (2.2 and 2.2.3) and modified the return values directly in JSON format. The previous API has been deprecated.
0.5
2011-04-06
v0.7
-3-
Table of Contents 7-CONNECT Merchant Integration Guide................................................................................................. 2 Revision History....................................................................................................................................... 3 1. 2. Introduction .................................................................................................................................... 5 7-CONNECT Web Services................................................................................................................ 6 2.1. 2.1.1. 2.1.2. 2.1.3. 2.1.4. 2.1.5. 2.2. 2.2.1. 2.2.2. 2.2.3. 3. 7-CONNECT Reference............................................................................................................ 6 Process Flow....................................................................................................................... 6 Request Parameters ........................................................................................................... 8 Response Parameters ......................................................................................................... 9 URLs ................................................................................................................................. 10 Sample Code .................................................................................................................... 10 Transaction Inquiry ............................................................................................................... 12 Request Parameters ......................................................................................................... 12 Response Parameters ....................................................................................................... 12 URLs ................................................................................................................................. 13
Merchant Web Services ................................................................................................................. 13 3.1. 3.2. 3.3. Requirements ....................................................................................................................... 13 Request Parameters ............................................................................................................. 13 Response Parameters ........................................................................................................... 14
v0.7
-4-
1. Introduction
Welcome to the 7-CONNECT Merchant Integration Guide. 7-CONNECT is 7-Elevens newest platform for e-commerce businesses that enables cash payment convenience for your customers. As a customer, you can now pay for online purchases at any 7-Eleven store. This guide assumes you have a working knowledge of the following: HTTP and webservice concepts SHA-1 hashing
7-CONNECT features the following: 24/7 cash payment at all 7-Eleven stores Increases your market beyond credit card holders Easier and faster than bank deposits Zero risk of fraud and chargebacks Real time notification of payment to your transaction systems
As a merchant, you will have access to new customers who do not have credit cards or who refuse to use them online. This opens up opportunities for you. There are no chargebacks or fraud to worry about. All completed transactions are guaranteed to be remitted to you. Integrating your website to 7-CONNECT will require development of two points: 7-CONNECT Reference Request: You will need to request for a 7-CONNECT Reference which will be used by customers to pay at the store. Merchant Payment API: This URL will enable the 7-Eleven store to notify your system in realtime whenever the customer pays at the store.
To get the latest information and graphic logos, pleas e visit the site: http://7-connect.philseven.com
v0.7
-5-
1. Customer selects 7-CONNECT as Payment Mode in Checkout. 2. Merchant Site sends a 7-CONNECT Reference Request to the 7-CONNECT Gateway. 3. 7-CONNECT Gateway displays the following instruction page displaying the Merchant details and the 7-CONNECT Reference. At this point, the Customer can:
v0.7
-6-
a. Write down the 7-CONNECT Reference or Print the page b. Proceed with the transaction 4. Customer selects Proceed. 5. 7-CONNECT Gateway redirects to the Merchants Success URL. 6. Merchant Site displays the Order Confirmation page.
v0.7
-7-
failURL
Text (300)
Yes
token
Text
Yes
transactionKey as provided by 7-CONNECT transactionDescription Text(128) No Will be shown in the customer LCD screen and payment instruction page (max of 128 characters) Will be printed in the receipt (if none, defaults to {merchantID}|{merchantRef}) (max of 660 characters). Use the |^ characters to instruct a new v0.7 -8-
receiptRemarks
Text(660)
No
line. The width of the receipt is 32 characters. Excess characters in a line will be truncated in the receipt. Example: "John Santos|^789 E. Rodriguez St.|^Call 777-7890 for questions|^Expected delivery date: 7/4/11" This will be rendered on the receipt as:
John Santos 789 E. Rodriguez St. Call 777-7890 for questions Expected delivery date: 7/4/11
Text
No
Used for notifications from 7-CONNECT to the customer. If not provided by the merchant, a button will appear in the instruction page to allow the customer to enter their email address.
v0.7
-9-
2.1.4. URLs
PRODUCTION URL: TEST URL: https://pay.7-eleven.com.ph/transact http://testpay.7-eleven.com.ph:8888/transact
v0.7
- 10 -
<td>Amount:</td> <td><input type="text" name="amount"></td></tr> <tr> <td><input type="submit" name="submit" value="Submit to 7-CONNECT"></td> </tr> </table> </form>
v0.7
- 11 -
2.2.
Transaction Inquiry
v0.7
- 12 -
2.2.3. URLs
PRODUCTION URL: TEST URL: https://pay.7-eleven.com.ph/inquire http://testpay.7-eleven.com.ph:8888/inquire
3.2.
Name type merchantRef amount
Request Parameters
Data Type Text Text (40) Number (12, 2) Text Required? Yes Yes Yes Description Valid values: VALIDATE, CONFIRM, VOID Merchants Reference Number Transaction Amount Format: XXXXXXXXXX.XX
token
Yes
Transaction Security Token To create this, get the SHA-1 digest of: type +merchantID + merchantRef + {transactionKey} transactionKey as provided by 7-CONNECT
v0.7
- 13 -
3.3.
Name type merchantRef amount
Response Parameters
Data Type Text Text (40) Number (12, 2) Text (20) Required? Yes Yes Yes Description Valid values: VALIDATE, CONFIRM, VOID Merchants Reference Number Transaction Amount Format: XXXXXXXXXX.XX
authCode
Valid values: SUCCESS, DECLINED Details for the declined transaction. Any remarks from the Merchant. This will be printed on the receipt. Transaction Security Token To create this, get the SHA-1 digest of: type + merchantID + merchantRef + authCode + responseCode + {transactionKey} transactionKey as provided by 7-CONNECT
token
Text
Yes
Sample Code
The following php code implements the merchant service that will handle VALIDATE, CONFIRM and VOID instructions coming from the 7-CONNECT gateway.
<?php /* This is the verification service that listens to payment transactions from the gateway. */ if (isset($_REQUEST['type'])) { $transactiontype = $_REQUEST['type']; $merchantRef = $_REQUEST['merchantRef']; $amount = $_REQUEST['amount']; $token = $_REQUEST['token']; // Check if token is valid // Replace merchantID with your merchant ID $transactionKey = '7ede208b7f8a58573057e7dde57fe8f3969fe0b2c32149c36b8c29ae9f744274'; $merchantID = 'TestMerchant01'; $validtoken = sha1($transactiontype . $merchantID . $merchantRef . '{' . $transactionKey . '}');
v0.7
- 14 -
if ($token != $validtoken) { $authCode = ""; $responseCode = "DECLINED"; $responseDesc = "Invalid token"; } else { $authCode = '1111'; $responseCode = "SUCCESS"; $responseDesc = ""; switch($transactiontype) { case "VALIDATE": // Check if merchantRef is still valid break; case "CONFIRM": // Update the paid status of the table break; case "VOID": // Update the paid status of the table break; default: $responseCode = "DECLINED"; $responseDesc = "Unknown transaction type"; } } $token = sha1($transactiontype . $merchantID . $merchantRef . $authCode . $responseCode . '{' . $transactionKey . '}'); //set GET variables $fields = array( 'merchantID'=>$merchantID, 'merchantRef'=>$merchantRef, 'amount'=>$amount, 'authCode'=>$authCode, 'responseCode'=>$responseCode, 'responseDesc'=>$responseDesc, 'token'=>$token ); $params = http_build_query($fields); //output response echo "?$params"; //write logfile $myFile = "/tmp/7-CONNECT.log"; $fh = fopen($myFile, 'a') or exit(); fwrite($fh, date('Y-m-d H:i ') . $params . "\n"); fclose($fh); }
v0.7
- 15 -
PSC
v0.7
- 16 -