Please, ensure that you use approved branding (e.g. buttons and assets) as provided by either Google Pay Android brand guidelines or Google Pay Web brand guidelines when
hutko supports the following values of parameters:
const allowedCardNetworks = ["MASTERCARD", "VISA"]; const allowedCardAuthMethods = ["PAN_ONLY", "CRYPTOGRAM_3DS"];
Pay attention, that BillingAddressParameters parameter is optional.
If you do not use SDK please define values for gatewayMerchantId and gatewayID parameters explicitly:
gatewayMerchantId: <your hutko merchant_id> gatewayID: hutko
Google Pay and 3DSecure
3DSecure authentication will be required for Google Pay for authorization method PAN_ONLY .
Consider this when implementing accept purchase with direct method as it can require two-steps flow:
create order: POST /api/3dsecure_step1
submit 3DSecure data: POST /api/3dsecure_step2
If you prefer to integrate directly against the Google Pay API, follow the Google Pay™ API documentation:
For Android: Google Pay Android developer documentation, Google Pay Android integration checklist and Google Pay Android brand guidelines.
For web: Google Pay Web developer documentation, Google Pay Web integration checklist and Google Pay Web Brand Guidelines.
Perform the following steps:
{ "apiVersion": 2, "apiVersionMinor": 0, "allowedPaymentMethods": [ { "type": "CARD", "parameters": { "allowedAuthMethods": [ "PAN_ONLY", "CRYPTOGRAM_3DS" ], "allowedCardNetworks": [ "VISA", "MASTERCARD" ] }, "tokenizationSpecification": { "type": "PAYMENT_GATEWAY", "parameters": { "gateway": "hutko", "gatewayMerchantId": "" } } } ], "transactionInfo": { "totalPrice": "", "totalPriceStatus": "FINAL", "currencyCode": "" } }
Please follow our base payment integration instruction for web-embedded Google Pay button.
No development from merchant side required to enable Google Pay button on hutko hosted checkout page.
Google Pay button is enabled for all hutko merchants in supported regions automatically.
Currently supported regions:
If you do not see Google Pay button enable in your web integration, please contact hutko your personal Account Manager. Possibly your integration must be reviewed and corrected, to enable Google Pay. For example, if you have a custom checkout design, you will require to update it.
Use the hutko Java Android SDK to start accepting Google Pay in your Android apps.
To connect Google Pay to the Android mobile app, follow these steps:
Add dependencies to your project in app/build.gradle. This implementation requires Google Play services 17.0.0 or greater as well as hutko Android SDK.
implementation 'com.google.android.gms:play-services-base:17.0.0' implementation 'com.google.android.gms:play-services-wallet:17.0.0' implementation 'com.cloudipsp.android:+'
Update AndroidManifest.xml to enable Google Pay API.
Add the following lines:
<application ...> .... <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /> .... </application>
For more information please follow Google Pay API setup instruction
Create an instance of Cloudipsp with your MerchantID identifier from hutko Merchant Portal:
cloudipsp = new Cloudipsp(<your merchant_id>, webView);
Add OnClick listener function on the Google Pay button.
Check this code for example:
In OnClick method call static method – Cloudipsp.supportsGooglePay();
Please check our demo example
Initiate payment on backend and obtain payment token:
Create order at your server:
curl -i -X POST \ -H "Content-Type:application/json" \ -d \ '{ "request": { "server_callback_url": "http://myshop/callback/", "order_id": "TestOrder_JSSDK_v2", "currency": "USD", "merchant_id": 1396424, "order_desc": "Test payment", "lifetime" : 999999, "amount": 1000, "signature": "91ea7da493a8367410fe3d7f877fb5e0ed666490" } }' \ 'https://pay.hutko.org/api/checkout/token'
Receive payment token:
{ "response":{ "response_status":"success", "token":"b3c178ad84446ef36eaab365b1e12e6987e9b3d9"} }
Call method – googlePayInitialize with token
In onGooglePayInitialized method by accepting the GooglePayCall class object into the component.
You should save it in onSaveInstanceState and restore it in onCreate methods. This is necessary due to the fact that the during external component load, the SDK component can be unloaded from memory.
Pass the result from onActivityResult to the SDK.
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case RC_GOOGLE_PAY: if (!cloudipsp.googlePayComplete(resultCode, data, googlePayCall, this)) { Toast.makeText(this, R.string.e_google_pay_canceled, Toast.LENGTH_LONG).show(); } break; } }
Handle result in the onPaidProcessed and onPaidFailure methods of the Cloudipsp.PayCallback interface.
gatewayMerchantId: <your hutko merchant_id> gatewayID: hutko