-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document line items and customer details
- Loading branch information
1 parent
0876a38
commit a94d151
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,6 +63,24 @@ $payment->setCurrencyCode($currency); | |
$payment->setTotalAmount(100); // Total cents | ||
$payment->setDescription(substr($description, 0, 45)); | ||
$storage->setInternalDetails($payment, $request); | ||
$payment->setDetails([ | ||
'square_item_name' => 'Payment name', // Optional, sets the line item to this product | ||
'square_line_items' => [ // Optional, sets the line items, and creates catalogue items | ||
[ | ||
'name' => 'Product Name', | ||
'qty' => 2, | ||
'amount' => 50, | ||
'note' => 'Optional Note', | ||
], | ||
// ... | ||
], | ||
'square_customer' => [ // Optional, sets this order to this customer | ||
'email' => '[email protected]', // Required | ||
'given_name' => 'Customer First Name', // Optional | ||
'family_name' => 'Customer Last Name', // Optional | ||
'id' => 'My internal id', // Optional | ||
], | ||
]); | ||
|
||
$captureToken = $payum->getTokenFactory()->createCaptureToken('square', $payment, 'done.php'); | ||
$url = $captureToken->getTargetUrl(); | ||
|