Skip to content

Commit

Permalink
Document line items and customer details
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbmarshall committed Aug 3, 2023
1 parent 0876a38 commit a94d151
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit a94d151

Please sign in to comment.