Business Database
Home Recent Index Add Login Graph Search  
Search in

Payment - Technical Specifications

This page contains information or links to the following:

Overview

data flow
phpYellow sends data to the gateway. At the gateway the customer enters the payment data. The transaction is processed by the gateway. The transaction is approved or declined.

Approval decision

If the transaction is approved then the gateway should be configured to automatically post back to phpyellow so that the customer listing can be updated.

Outcome of a decline

If the transaction is declined the reason for the decline should be made clear to the customer. The processing may then [optionally] return to a phpyellow page [example:sorry.php].

Data out

Payment scripts on phpyellow make the submission [post] to the gateway containing the phpyellow and gateway specific data going out. Following is the data required by phpyellow to be sent out:

Table of data out variables
Variable name data type required? example
ckey integer yes 1234
rank integer yes 4
duration* integer yes 12

* The value for the variable named duration is in months, not days

Data out for a specific gateway

The data out for a specific gateway varies with the gateway. See your gateway implementation guide for details on the data you must send to your gateway. At minimum the gateway will require a total price to be charged, and will also collect contact and other payment information at the gateway.

Variable name data type required? example
amount float no* 98.76

* the variable called amount is NOT required by phpyellow however amount is normally required by the gateway. Financial transaction data is NOT saved by phpyellow. This data is typically saved on your gateway.

Data in

The data sent back in to phpyellow from the gateway must contain the variables called:

  • ckey
  • rank
  • duration
The data sent back in to phpyellow from the gateway is the same data that was originally sent out, as above. ckey identifies the listing. rank carries the desired listing type to upgrade to. duration holds the length of time (from todays date) the listing will be extended.

Affected files and their functions

Following is a list of files used in the payment process and the function the file performs:

Files used to send data out

  • checkout.php - customer makes listing, duration and payment choices
  • frequency.php - holds recurring payment choices
  • buy.php - manipulates data and routes the payment choice
  • data_out.php - final phpyellow form used to send transaction to the gateway

Files used to accept data in

  • data_in.php - accepts gateway approval, updates customer listing
  • sorry.php - page shown with a declined transaction [optional]
data_in.php should ONLY be used with a successful transaction. Do not post failed transactions to data_in.php. Send failed transactions to sorry.php

How to add other gateways

Other gateways will need to have a url to send the transaction to, as well as gateway specific data.

Gateway URL

The url to post data to may be one of:
  1. Paypal or
  2. a phpyellow internal test url, or
  3. your gateway url
To add your gateway url open buy.php and add your url value to the switch($method) statement case "Credit Card by Internet" found at about roughly line 200 [line number varies with version]:

						
case"Credit Card by Internet": 
   if(!isset($_POST['formActionValue'])) { // if there is no value, then give it a value
      $_POST['formActionValue'] = "Enter your gateway url value here in buy.php";
   }
   // ... more code ...
						
					
Gateway specific data may include hidden html variables and preprocessed code.

Hidden html variables

  1. open pro_gateway_variables.php
  2. create all of the variables your gateway requires using html hidden input types

    example
    <input type="hidden" name="account" value="12345">

  3. save pro_gateway_variables.php on your web server in your /phpyellow folder
data_out.php automatically includes pro_gateway_variables.php whenever a credit card by internet method is chosen.

Sample form for posting to your gateway

A sample form for posting to your gateway is data_out.php included with every Pro Edition purchase.

Generating a unique product id for each listing

How a product_id may be generated - used with 2checkout.com recurring billing - for reference only

Rank     Position       Duration (months)    product_id
0        Bronze         3                    1
0        Bronze         6                    2
0        Bronze         12                   3
1        Silver         3                    4
1        Silver         6                    5
1        Silver         12                   6
2        Gold           3                    7
2        Gold           6                    8
2        Gold           12                   9
3        Mini-webpage   3                    10
3        Mini-webpage   6                    11	
3        Mini-webpage   12                   12
4        Sponsor        3                    13
4        Sponsor        6                    14
4        Sponsor        12                   15

Preprocessed code or other module

Your gateway may require additional pre-processing or other code modules. In general, pre-processing should be made by customizing or including other files in buy.php resulting in the final form to post being data_out.php

Offer to connect payment gateway

We can connect phpYellow Pro EditionTM with your own payment gateway provider. Contact us for details.

Powered by phpYellow  
All content Copyright©2024 Russian-American Business. All rights reserved. Terms of Use. Privacy. Documentation. Contact Us.