# GCash

**GCash is an all-in-one app that allows users to safely make online and in-store payments, as well as mobile top ups and bill payments.**

## **Features**

| Processing currencies      | PHP                  |
| -------------------------- | -------------------- |
| Settlement currencies      | GBP,USD,EUR,HKD      |
| Minimum transaction amount | 1 PHP                |
| Maximum transaction amount | No Transaction Limit |
| Refunds                    | ✅                    |
| Partial Refunds            | ✅                    |
| Multiple partial refund    | ❌                    |
| Chargeback                 | ❌                    |

# **Integration Method**

**Payment method enumeration values:** **`gcash`**

**There is integration method for GCash**

1. Direct API
2. Checkout

## **Direct** **API** 

### **How to integration**

For direct API integration, you can create a PaymentIntent and get url in only one step. The following is the demo of creating payment intent:

[**Create a PaymentIntent**](api-42631218)

A PaymentIntent is an object that represents your intent to collect payment from your customer and tracks the lifecycle of the payment process. Create a PaymentIntent on your server and specify the amount to collect and a supported currency. If you have an existing Payment Intents integration, add **`gcash`** to the list of payment method types.

***Request***

```JSON
{
    "amount":30000,
    "currency":"PHP",
    "confirm":true,
    "payment_method_options":{
        "gcash":{
            "terminal_type":"WEB"
        }
    },
    "payment_method_data":{
        "type":"gcash"
    },
    "merchant_order_id":"商户订单号",
    "return_url":"https://wooshpay.com"
}
```

***Response***

```JSON
{
    "id": "pi_1692411609156157440",
    "object": "payment_intent",
    "created": 1692337346000,
    "livemode": false,
    "currency": "PHP",
    "amount": 30000,
    "status": "requires_action",
    "merchant_order_id": "商户订单号",
    "client_secret": "pi_1692411609156157440_secret_LTUJaQca5yi6krhonAQoGUL8",
    "next_action": {
        "type": "redirect_to_url",
        "gcash_handle_redirect": {
            "url": "https://open-sea-global.alipayplus.com/api/open/v1/ac/cashier/self/codevalue/checkout.htm?codeValue=2816660400932RVP49jpe2t3Jz6HrZO304ax&loadMode=2"
        }
    },
    "payment_method_types": [
        "gcash"
    ],
    "confirmation_method": "automatic",
    "payment_method_options": {
        "gcash": {
            "terminal_type": "WEB"
        }
    },
    "return_url": "https://wooshpay.com",
    "payment_method": "pm_1692411609059688448",
    "capture_method": "automatic"
}
```
## **Checkout**

### Payment flow

1. Customer selects BPI from the list of payment methods available and clicks on the Pay botton


![下载.png](https://api.apifox.com/api/v1/projects/1296482/resources/423434/image-preview)

1. Customers will be redirected to Gcash login page


![下载 (1).png](https://api.apifox.com/api/v1/projects/1296482/resources/423435/image-preview)
1. The client logs in to Gcash account and completes payment
2. Payment succeeds and the client is redirected back to the page you designated

### [Create a Session](api-42654181)

***Request***

```json
{
    "cancel_url": "www.wooshpay.com",
    "mode": "payment",
    "success_url": "https://wooshpay.com/",
    "payment_method_types": [
        "gcash"
    ],
    "line_items": [
        {
            "price_data": {
                "currency": "PHP",
                "product": null,
                "unit_amount": 20000,
                "active": true,
                "metadata": {
                    "key1": "value1",
                    "key2": "value2"
                },
                "nickname": "apple",
                "product_data": {
                    "id": null,
                    "name": "apple",
                    "active": true,
                    "description": "very delicious",
                    "metadata": {
                        "key1": "value1",
                        "key2": "value2"
                    },
                    "url": "www.wooshpay.com"
                },
                "billing_scheme": "testscheme",
                "lookup_key": "test_lookup_key"
            },
            "quantity": 1
        }
    ]
}
```

***Response***

```JSON
{
    "id": "cs_1661926259464077312",
    "object": "checkout.session",
    "created": 1685069072000,
    "currency": "PHP",
    "customer": "",
    "mode": "payment",
    "livemode": false,
    "status": "open",
    "url": "https://checkouttest.wooshpay.com/pay/cs_test_1661926259464077312?key=pk_test_NTE1OTU5NzQ3NTQ2MTM5ODkzNzcxOktFZ0xlam1KbUxUb2gyUUNqWVVoaGpDSjE2NjkzNDUwMDgxMTE=",
    "cancel_url": "www.wooshpay.com",
    "line_items": {
        "object": "list",
        "data": [
            {
                "id": "li_1661926259510214656",
                "object": "item",
                "currency": "PHP",
                "description": "apple",
                "price": {
                    "id": "price_1661926259543769088",
                    "object": "price",
                    "created": 1685069072000,
                    "active": true,
                    "currency": "PHP",
                    "metadata": {
                        "key1": "value1",
                        "key2": "value2"
                    },
                    "nickname": "apple",
                    "product": {
                        "id": "prod_1661926259560546304",
                        "object": "product",
                        "created": 1685069072000,
                        "active": true,
                        "description": "very delicious",
                        "metadata": {
                            "key1": "value1",
                            "key2": "value2"
                        },
                        "name": "apple",
                        "livemode": false,
                        "url": "www.wooshpay.com",
                        "updated": 1685069072000
                    },
                    "type": "one_time",
                    "livemode": false,
                    "unit_amount": 20000,
                    "billing_scheme": "per_unit",
                    "lookup_key": "test_lookup_key"
                },
                "quantity": 1,
                "amount_subtotal": 20000,
                "amount_total": 20000
            }
        ]
    },
    "payment_intent": "pi_1661926259778650112",
    "payment_method_types": [
        "gcash"
    ],
    "payment_status": "unpaid",
    "success_url": "https://wooshpay.com/",
    "amount_subtotal": 20000,
    "amount_total": 20000,
    "billing_address_collection": "auto",
    "expires_at": 1685155472015,
    "payment_link": "",
    "client_secret": "pi_1661926259778650112_secret_BtNbU3T2LqvdqRNTYsXsgkh3"
}
```

# **Next step**

You can add more features to your integration as needed

## [Create a Webhook](doc-2517709)

Listen to events on your WooshPay account so your integration can automatically trigger reactions. Create a webhook that mainly focuses on enabled_events and url.

## [Create a Refund](api-51369554)

Create a refund to repay funds to your customer. You can also perform partial refunds, but not every payment method supports them. A partial refund is when you refund only part of the original transaction amount.
