Skip to content

Cake PHP Optimal Payment Component with ccPurchase, ccAuthorize, ccVerification, ccSettlement, ccStoredDataPurchase and ccStoredDataAuthorize

Notifications You must be signed in to change notification settings

subingp/cakephp-2.0-optimal-payment-component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#Cake PHP Optimal Payment Component with ccPurchase, ccAuthorize, ccVerification, ccSettlement, ccStoredDataPurchase and ccStoredDataAuthorize

The main features implmented are,

  • Purchase with credit card info .
  • Purchase Authorization with credit card info : [for those who not aware about Auth:, This is process of getting a permission to get a money(Called Capture) in future based on users permission gained in Approval(Authorization) part. ]
  • Verify/Validate the credit card Information.
  • Ability to purchase new item/product based on users previous purchase data(Does not means we are saving an credit card info).

##Minimum Requirements

  • Cake PHP 1.3 or later
  • cURL support
  • SimpleXml

##Main Modules includes

  • ccPurchase
  • ccAuthorize
  • ccVerification
  • ccSettlement,
  • ccStoredDataPurchase
  • ccStoredDataAuthorize

##Implementation

Models

Add models for logs and necessary change to save info

Controller

Add Optimal Payment component in the components array( Sorry Cake gurus. It is intented for all from freshers to gurus ;) ).

public $components = array(
        'All',
        'YourExisting',
        'Components ',
        'OptimalPayment',
    );

Views

Necessary Codes to get user inputs, like amount and credit card info

##Sample Implementation

// This is sample code to show how it works
// Please add necessary code for get input from user, validation,.. 

$merchant_info = array(
	'accountNum' =>'MERCHANT_ACC_NUMBER',
	'storeID' =>'test',
	'storePwd' =>'test',
	'is_test' => true,
);
$payment_info= array(
	'user_id' => '1111111111111',
	'amount' => 22,
	'card_deatils' =>array(
		'cardNum' =>'1111111111111111',
		'cardExpiry' =>array(
			'month' => '12',
			'year' =>  '12'
		),
		'cardType' => 'VI',
		'cvdIndicator' =>1, // Do we need CVV
		'cvd' =>'111'
	),
	'billing_info' => array(
		"firstName"	=> 'Test',
		"lastName"	=> 'Test',
		"street"	=>  '1130 test',
		"street2"	=>  '',
		"city"		=>  'Laval',
		"state"		=>  'QC',
		"country"	=>  'CA',
		"zip"		=>  'H7V 1A2',
		"phone"		=>  '123-973-2227',
		"email"		=>  'email@example.com',
	)
);

$this->OptimalPayment->intiatePayment($merchant_info);
// Authorization
$result = $this->OptimalPayment->doAuthorize($payment_info);

$reversal_info = array(
	'user_id' => '1111111111111',
	'amount'  => 22,
	'confirmation_number' =>'233444',
);

//$result = $this->OptimalPayment->doAuthReversal($reversal_info);

$cpature_info = array(
	'user_id' => '1111111111111',
	'amount'  => 22,
	'confirmation_number'=>'1233',
);

$result = $this->OptimalPayment->doAuthSettlement($cpature_info);

About

Cake PHP Optimal Payment Component with ccPurchase, ccAuthorize, ccVerification, ccSettlement, ccStoredDataPurchase and ccStoredDataAuthorize

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published