Option | Value |
1 | 50MB |
2 | 100MB |
3 | 200MB |
3 | 1GB |
Value | Item ID in SQL |
Data_50MB | 6 |
Data_100MB | 7 |
Data_200MB | 8 |
Data-Standard-1G | 9 |
Finding the Item ID in SQL:
SELECT * FROM profiles;
SELECT * FROM realms;
SELECT * FROM users;
Value | Item ID in SQL |
College | 35 |
Value | Item ID in SQL |
admin_college | 182 |
Config file editing
//Use this as a reference to complete the other three
//From Paypal data 'item_name' (RDVoucher') 'item_number' (rd_v1) option_selection1 ('1GB')
$config['paypal']['RDVoucher']['rd_v1']['1GB'] = array(
'precede' => '',
'profile_id' => 9,
'profile' => 'Data-Standard-1G',
'realm_id' => 34,
'realm' => 'Residence Inn',
'sel_language' => '4_4',
'user_id' => '182'
);
Be sure to use revision 1073 or higher for the FinPaypalTransactionsController.php controller in order to include support for single field vouchers.
Also ensure that you supply both the realm name and id as well as the profile name and id in the voucher definition.
Next we will configure the SMTP setup for the CakePHP application in order for us to email the voucher details to the person who purchased the voucher.
Install Postfix and Mutt
sudo apt-get install postfix
#Choose the defaults which works just fine if you simply want to send email from your server over the Internet while **NOT** relaying for other domains.
sudo apt-get install mutt
touch mail.txt
mutt -s "Test PayPal SMTP setup" dirkvanderwalt@gmail.com < mail.txt
When you use the Server as an SMTP server be aware that many spam checking engines are most likely to label your email as SPAM!
Rather make use of a dedicated SMTP server like Gmail in order to avoid disappointment.
public $default = array(
'transport' => 'Mail',
'from' => 'you@localhost',
//'charset' => 'utf-8',
//'headerCharset' => 'utf-8',
);
To select one of those definitions we in the PayPal Controller we specify it in the usr/share/nginx/html/cake2/rd_cake/Controller/FinPaypalTransactionsController.php file.
Here we changed the value form smtp to default.
//Around line 321...
App::uses('CakeEmail', 'Network/Email');
$Email = new CakeEmail();
//$Email->config('smtp');
$Email->config('default');
$Email->subject('Your voucher detail');
....
Be sure you covered all the $Email→config('whatever') in the file. There are more than one!
Specify a test email
Most of the transactions in the PayPal Sandbox are with non-existing email addresses.
To overcome this we override them with a test email address to whom emails will be addressed to.
Edit the usr/share/nginx/html/cake2/rd_cake/Controller/FinPaypalTransactionsController.php file and look for the following part where you can add the test email of your choice.
//FIXME replace with real one when going live!!!
//$payer_email = $q_r['FinPaypalTransaction']['payer_email'];
$payer_email = 'dirkvanderwalt@gmail.com';
$data = Configure::read('paypal.'.$item_name.'.'.$item_number.'.'.$option_selection1);