@@ -317,6 +317,21 @@ $creditCard = new CreditCard([
317
317
though * some* banks insist it is present and valid.
318
318
* This gateway lives on an extended ASCII ISO 8859-1 back end.
319
319
Really. Do any characterset conversions in your merchant site to avoid surprises.
320
+ * Both billing and shipping name and address is required.
321
+ However, you can use the ` billingForShipping ` flag to set the shipping details
322
+ to what you supply as the billing details.
323
+
324
+ ``` php
325
+ // Use the billing name and address for the shipping name and address too.
326
+ $gateway->setBillingForShipping(true);
327
+
328
+ // or
329
+
330
+ $response = $gateway->authorize([
331
+ 'billingForShipping' => true,
332
+ ...
333
+ ]);
334
+ ```
320
335
321
336
``` php
322
337
// Create a unique transaction ID to track this transaction.
@@ -337,7 +352,7 @@ $surchargeXml = '<surcharges>'
337
352
// Send the authorize request.
338
353
// Some optional parameters are shown commented out.
339
354
340
- $response = $gateway->authorize(array(
355
+ $response = $gateway->authorize([
341
356
'amount' => '9.99',
342
357
'currency' => 'GBP',
343
358
'card' => $card,
@@ -350,7 +365,7 @@ $response = $gateway->authorize(array(
350
365
// 'token' => $token,
351
366
// 'cardReference' => $cardReference,
352
367
// 'useAuthenticate' => true,
353
- ) )->send();
368
+ ] )->send();
354
369
355
370
If `useAuthenticate` is set, then the `authorize` will use the `AUTHENTICATE`/`AUTHORISE`
356
371
method of reserving the transaction details.
@@ -460,16 +475,16 @@ The URL for the notification handler is set in the authorize or payment message:
460
475
461
476
$transactionId = {create a unique transaction id};
462
477
463
- $items = array(
464
- array(
478
+ $items = [
479
+ [
465
480
'name' => 'My Product Name',
466
481
'description' => 'My Product Description',
467
482
'quantity' => 1,
468
483
'price' => 9.99,
469
- )
470
- ) ;
484
+ ]
485
+ ] ;
471
486
472
- $response = $gateway->purchase(array(
487
+ $response = $gateway->purchase([
473
488
'amount' => 9.99,
474
489
'currency' => 'GBP',
475
490
// Just the name and address, NOT CC details.
@@ -479,7 +494,7 @@ $response = $gateway->purchase(array(
479
494
'transactionId' => $transactionId,
480
495
'description' => 'test',
481
496
'items' => $items,
482
- ) )->send();
497
+ ] )->send();
483
498
484
499
// Before redirecting, save `$response->getSecurityKey()` in the database,
485
500
// retrievable by `$transactionId`.
@@ -1004,15 +1019,15 @@ If you want to include VAT amount in the item array you must use
1004
1019
` \Omnipay\SagePay\Extend\Item ` as follows.
1005
1020
1006
1021
``` php
1007
- $items = array(
1008
- array( new \Omnipay\SagePay\Extend\Item(array(
1022
+ $items = [
1023
+ [ new \Omnipay\SagePay\Extend\Item([
1009
1024
'name' => 'My Product Name',
1010
1025
'description' => 'My Product Description',
1011
1026
'quantity' => 1,
1012
1027
'price' => 9.99,
1013
1028
'vat' => 1.665, // VAT amount, not percentage
1014
- ))
1015
- ) ;
1029
+ ]]
1030
+ ] ;
1016
1031
```
1017
1032
1018
1033
# Support
0 commit comments