Skip to content

Commit fc6222f

Browse files
authored
Update README.md
1 parent 00b835d commit fc6222f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,18 @@ Step 1: Include the following code into your AppController.php to load the payst
5151
$this->loadComponent('PayStack.CurlConnection');
5252
?>
5353

54-
55-
Step 2: in your controller create an action, mine will be PurchaseSMS()
54+
Step 2:create view using the following code
55+
56+
<?php
57+
//Note This form will be setup as per you requirement. in my case i needed to pay for sms units
58+
echo $this->Form->create(null,['url'=>['controller'=>'as-per-requirement','action'=>'purchase-sms']]);
59+
echo $this->Form->input('amount',['templates'=>['inputContainer'=>'<div class="form-group">{{content}}<p class=" mb-3 mt-2"> <span id="allocatedUnits" class="text-danger pull-right small ">0 </span><span class="small pull-right text-muted mr-2 ">UNIT(S) Worth: </span><span class="small text-muted mr-2"> Send to </span><span id="reach" class="text-danger small ">0 </span></p></div>'],'class'=>'form-control','style'=>'resize:none','maxlength'=>"290",'options'=>['500'=>'500','1000'=>'1000','1500'=>'1500','2000'=>'2000','3000'=>'3000','5000'=>'5000','7000'=>'7000','10000'=>'10000'],'empty'=>'Select amount you want to pay','id'=>'sms-amount']);
60+
echo $this->Form->submit('PURCHASE UNITS',['class'=>'btn btn-sm btn-danger btn-block mt-2 ']);
61+
echo $this->Form->end();
62+
63+
?>
64+
65+
Step 3: in your controller create an action, mine will be PurchaseSMS()
5666

5767
<?php
5868

0 commit comments

Comments
 (0)