Skip to content

Commit

Permalink
Readme update.
Browse files Browse the repository at this point in the history
  • Loading branch information
amostajo committed Jun 26, 2015
1 parent d7009ea commit c097df2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ To empty cart:
$cart->clear();
```

This methods can be chained:
These methods can be chained:

```php
$cart->add($product, 5)
Expand Down Expand Up @@ -889,11 +889,11 @@ $completed_orders = Order::whereUser($userId)

Status codes out of the box:
- `in_creation` — Order status in creation. Or use `$order->isInCreation`.
- `pending` — i.e. Pending for payment. Or use `$order->isPending`.
- `in_process` — i.e. In process of shipping. In process of revision. Or use `$order->isInProcess`.
- `completed` — i.e. When payment has been made and items were delivered to client. Or use `$order->isCompleted`.
- `failed` — i.e. When payment failed. Or use `$order->hasFailed`.
- `canceled` — i.e. When an order has been canceled by the user. Or use `$order->isCanceled`.
- `pending` — Pending for payment. Or use `$order->isPending`.
- `in_process` — In process of shipping. In process of revision. Or use `$order->isInProcess`.
- `completed` — When payment has been made and items were delivered to client. Or use `$order->isCompleted`.
- `failed` — When payment failed. Or use `$order->hasFailed`.
- `canceled` — When an order has been canceled by the user. Or use `$order->isCanceled`.

You can use your own custom status codes. Simply add them manually to the `order_status` database table or create a custom seeder like this:

Expand Down Expand Up @@ -970,7 +970,7 @@ class GatewayPayPal extends PaymentGateway
}
```

The gateway will require those `onCharge` method as minimun. You can add more depending your needs.
The gateway will require `onCharge` method as minimun. You can add more depending your needs.

Once created, you can add it to the `shop.php` config file, like:

Expand Down Expand Up @@ -1006,8 +1006,8 @@ public function onCharge($order)
}
```
- `transactionId` — Provider's transaction ID, will help identify a transaction.
- `detail` — i.e. Custom description for the transaction.
- `statusCode` — i.e. Order status code with which to update the order after onCharge has executed. By default is 'completed'.
- `detail` — Custom description for the transaction.
- `statusCode` — Order status code with which to update the order after onCharge has executed. By default is 'completed'.

### Callbacks

Expand Down Expand Up @@ -1081,7 +1081,7 @@ class GatewayWithCallbacks extends PaymentGateway
}
}
```
In the example above, `onCharge` instead of creating a completed transaction, it is creating a pending transaction and indicating the provider to which urls to call back with the payment results. By default the shop generates a token and it is used for validations in the callback, you can change the token value to your needs.
In the example above, `onCharge` instead of creating a completed transaction, it is creating a pending transaction and indicating the provider to which urls to call back with the payment results.

The methods `onCallbackSuccess` and `onCallbackFail` are called by `Shop` when the provider calls back with its reponse, the proper function will be called depending on the callback url used by the provider.

Expand Down

0 comments on commit c097df2

Please sign in to comment.