@@ -30,7 +30,7 @@ $gateway = GatewayFactory::create('Stripe');
3030$gateway->setApiKey('abc123');
3131
3232$formData = ['number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2016', 'cvv' => '123'];
33- $response = $gateway->purchase(['amount' => 1000 , 'currency' => 'USD', 'card' => $formData])->send();
33+ $response = $gateway->purchase(['amount' => '10.00' , 'currency' => 'USD', 'card' => $formData])->send();
3434
3535if ($response->isSuccessful()) {
3636 // payment was successful: update database
@@ -252,7 +252,7 @@ Pass the options through to the method like so:
252252``` php
253253$card = new CreditCard($formData);
254254$request = $gateway->authorize([
255- 'amount' => 1000 , // this represents $10.00
255+ 'amount' => '10.00' , // this represents $10.00
256256 'card' => $card,
257257 'returnUrl' => 'https://www.example.com/return',
258258]);
@@ -281,7 +281,7 @@ For a successful responses, a reference will normally be generated, which can be
281281at a later date. The following methods are always available:
282282
283283``` php
284- $response = $gateway->purchase(['amount' => 1000 , 'card' => $card])->send();
284+ $response = $gateway->purchase(['amount' => '10.00' , 'card' => $card])->send();
285285
286286$response->isSuccessful(); // is the response successful?
287287$response->isRedirect(); // is the response a redirect?
@@ -299,7 +299,7 @@ POST (FormRedirectResponse). These could potentially be combined into a single r
299299After processing a payment, the cart should check whether the response requires a redirect, and if so, redirect accordingly:
300300
301301``` php
302- $response = $gateway->purchase(['amount' => 1000 , 'card' => $card])->send();
302+ $response = $gateway->purchase(['amount' => '10.00' , 'card' => $card])->send();
303303if ($response->isSuccessful()) {
304304 // payment is complete
305305} elseif ($response->isRedirect()) {
@@ -332,7 +332,7 @@ You can handle both scenarios by wrapping the entire request in a try-catch bloc
332332
333333``` php
334334try {
335- $response = $gateway->purchase(['amount' => 1000 , 'card' => $card])->send();
335+ $response = $gateway->purchase(['amount' => '10.00' , 'card' => $card])->send();
336336 if ($response->isSuccessful()) {
337337 // mark order as complete
338338 } elseif ($response->isRedirect()) {
@@ -359,7 +359,7 @@ are available:
359359
360360Once you have a ` cardReference ` , you can use it instead of the ` card ` parameter when creating a charge:
361361
362- $gateway->purchase(['amount' => 1000 , 'cardReference' => 'abc']);
362+ $gateway->purchase(['amount' => '10.00' , 'cardReference' => 'abc']);
363363
364364## Recurring Billing
365365
0 commit comments