Return an item in order
  • 26 Feb 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Return an item in order

  • Dark
    Light

Article summary

Description:

To document the return function, This function is used to process returns for products with the specified transaction ID.

Parameters:

  • string $type: Specifies whether the return is partial or full.

  • array $product: Array containing information about the product(s) being returned.

  • string $transaction_id: The unique transaction ID associated with the order.

use Stegback\Ratepay\Services\RatepayReturn;
{
      $product = [
            'total_amount' => '1000.00', // if you want full cancellation make amount 0;
            // item not required in the case of full cancellation only mentaion that product which you want to cancel
            'item' => [
                [
                    'product_id' => 1,
                    'product_quantity' => 1,
                    'product_price' => 10,
                    'product_name' => 'Article A',
                ],
            ],
            'discount' => 0, // if any define here
        ];
        $object = new RatepayReturn;

  $response = $object->return('partial', $productArray, 'your_genrated_transaction_id');
}


Was this article helpful?