We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$item2 = Paypalpayment::item(); $item2->setName('Granola bars') ->setDescription('Granola Bars with Peanuts') ->setCurrency('USD') ->setQuantity(5) ->setTax(0.2) ->setPrice(2);
My Problem is I want to make this Array Dynamic. When I insert this code in a loop it shows me error. Please suggest me a process
The text was updated successfully, but these errors were encountered:
I would do something like below :)
$all_items_arr = []; foreach ($items as $addon) { $addon_item = Paypalpayment::item(); $addon_item->setName($addon['title']) ->setDescription($addon['title']) ->setCurrency($addon['currency']) ->setQuantity($addon['qty']) ->setTax($addon['tax']) ->setPrice((float) $addon['price']); $all_items_arr[] = $addon_item; } $itemList = Paypalpayment::itemList(); $itemList->setItems($all_items_arr); //transaction object $transaction = Paypalpayment::transaction(); $transaction->setAmount($amount) //here amount will be total amount including tax ->setItemList($itemList) ->setDescription("Payment description") ->setInvoiceNumber(uniqid()); $payment = Paypalpayment::payment();
Sorry, something went wrong.
No branches or pull requests
My Problem is I want to make this Array Dynamic. When I insert this code in a loop it shows me error. Please suggest me a process
The text was updated successfully, but these errors were encountered: