I'm using react-native for my app, it requires online payments. Since lots of people already using "gcash" to pay online, I'd like to ask if there is an API for that?
I'm using react-native for my app, it requires online payments. Since lots of people already using "gcash" to pay online, I'd like to ask if there is an API for that?
Not sure if GCash provides their own API but Paymongo has an API that can collect G-Cash payments. Perhaps you can check it out. Looks like they just charge per transaction.
Per https://developers.paymongo.com/docs/accepting-gcash-payments, Collecting GCash payments on your website starts with creating a resource to generate a checkout URL where your customer needs to authorize an amount, wait for the authorization to complete and create a Payment resource to receive the authorized amount. A Source resource is used to generate GCash checkout URL to authorize a certain amount to be deducted from your customer's GCash account and send it to your PayMongo account. After completing the authorization, your integration uses the chargeable source to make a create payment request and receive the payment.
Specific API endpoints are listed on https://developers.paymongo.com/reference.
You can try using curl. This link may help you.
curl https://checkout-test.adyen.com/v66/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"merchantAccount":"YOUR_MERCHANT_ACCOUNT",
"reference":"YOUR_ORDER_NUMBER",
"amount":{
"currency":"PHP",
"value":1000
},
"paymentMethod":{
"type":"gcash"
},
"returnUrl":"https://your-company.com/checkout?shopperOrder=12xy.."
}'
$client = new \Adyen\Client();
$client->setXApiKey("YOUR_X-API-KEY");
$service = new \Adyen\Service\Checkout($client);
$params = array(
"amount" => array(
"currency" => "PHP",
"value" => 1000
),
"reference" => "YOUR_ORDER_NUMBER",
"paymentMethod" => array(
"type" => "gcash"
),
"returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy..",
"merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
);
$result = $service->payments($params);