A sample node.js app which demonstrates completing a Google Pay transaction with Eway.
- To enable Google Pay on the account, login to MyeWAY http://au.myeway.com.
- Go to
Google Pay Settings
page inSettings > Google Pay Settings
. - Read and agree to the terms and conditions by checking the
"I agree to the terms and conditions"
box. - Enter the Google Pay Merchant ID. This is the ID you were provided once successfully onboarded on Google Pay.
- Click the Activate Button
The merchant has been onboarded with Google Pay via MyEway, see onboarding guide for the details.
Setup for Credentials and Endpoint for the app are located in the payments.js
file.
You will need to create a .env
file with the keyValue pair for APIKEY
, PASS
and TESTURL
.
Google Pay is integrated into the Eway Responsive Shared Page. Once Google Pay is enabled and onboarded in MyEway, no further steps are required.
When using Transparent Redirect, the first step of generating an Access Code is the same as Transparent Redirect.
To request an Access Code, make a server-side call to the CreateAccessCode method of Rapid API. The service will respond with an Access Code, a Form Action URL and the customer data.
The difference is that instead of sending the Card Details to the Form Action URL, you send the Google Pay Network token. You must include these 3 fields in your form-data request:
EWAY_ACCESSCODE
EWAY_PAYMENTTYPE
EWAY_GOOGLEPAY_NETWORKTOKEN
Where EWAY_PAYMENTTYPE
is set to GooglePay
.
You can find an example to Google Pay Network Token here.
Example:
<form method="POST" action="<<FormActionURL Goes Here>>" id="payment_form">
<input type="hidden" name="EWAY_ACCESSCODE" value="<<AccessCode Goes Here>>" />
<input type="hidden" name="EWAY_PAYMENTTYPE" value="GooglePay" />
<input type="hidden" name="EWAY_GOOGLEPAY_NETWORKTOKEN" value="{{TOKEN}}" />
<input type="submit" value="Process" text="Process" />
</form>
Once the transaction has been processed, request the results from Eway using the Access Code.
Type | Gateway URL |
---|---|
REST (POST) | https://api.ewaypayments.com/Transactions/ |
Type | Gateway URL |
---|---|
REST (POST) | https://api.sandbox.ewaypayments.com/Transactions/ |
Rapid Plus API Direct Connection can accept Google Pay Token to process Purchase / PreAuth payments.
- Call the Rapid plus endpoint
/Transactions
with a request that contains the payment instrument and the payment type: Google Pay. - Send the Google pay token in the WalletDetails object > Token.
Example Google Pay Request
{
"paymentInstrument": {
"paymentType": "GooglePay",
"walletDetails": {
"Token": "{ \"protocolVersion\": \"ECv2\", \"signature\": \"MEQCIH6Q4OwQ0jAceFEkGF0JID6sJNXxOEi4r+mA7biRxqBQAiAondqoUpU\/bdsrAOpZIsrHQS9nwiiNwOrr24RyPeHA0Q\\u003d\\u003d\",
\"intermediateSigningKey\": { \"signedKey\": \"{\\\"keyExpiration\\\":\\\"1542323393147\\\",\\\"keyValue\\\":\\\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE\/1+3HBVSbdv+j7NaArdgMyoSAM43yRydzqdg1TxodSzA96Dj4Mc1EiKroxxunavVIvdxGnJeFViTzFvzFRxyCw\\\\u003d\\\\u003d\\\"}\", \"signatures\": [ \"MEYCIQCO2EIi48s8VTH+ilMEpoXLFfkxAwHjfPSCVED\/QDSHmQIhALLJmrUlNAY8hDQRV\/y1iKZGsWpeNmIP+z+tCQHQxP0v\" ] }, \"signedMessage\": \"{\\\"tag\\\":\\\"jpGz1F1Bcoi\/fCNxI9n7Qrsw7i7KHrGtTf3NrRclt+U\\\\u003d\\\",\\\"ephemeralPublicKey\\\":\\\"BJatyFvFPPD21l8\/uLP46Ta1hsKHndf8Z+tAgk+DEPQgYTkhHy19cF3h\/bXs0tWTmZtnNm+vlVrKbRU9K8+7cZs\\\\u003d\\\",\\\"encryptedMessage\\\":\\\"mKOoXwi8OavZ\\\"}\"}"
}
},
"Payment": {
"TotalAmount": 100,
"currencyCode": "AUD"
},
"Method": "ProcessPayment",
"TransactionType": "Ecom"
}
- The Method can be
ProcessPayment
for normal payment orPreAuthorisation
for PreAuth payment. - The response will include the tranasction result.
Response Message | Reason |
---|---|
V6125 | Selected Payment Type Not Enabled |
S5017 | Google Pay processing error |
V7100 | GooglePay Not Supported By Gateway |
V7101 | TokenCustomer and GooglePay should not coexist at the same time |
V7102 | Invalid GooglePay request, IntermediateSigningKey has no value |
V7103 | Invalid GooglePay request, Signature has no value |
V7104 | Invalid GooglePay request, Version number is not supported |
V7105 | Invalid GooglePay request, SignedMessage is null |
V7106 | Invalid GooglePay request, IntermediateSigningKey.SignedKey has no value |
V7107 | Invalid GooglePay request, IntermediateSigningKey.Signatures has no value |
V7109 | Invalid GooglePay request, GooglePay isn't available in your country |
V7110 | Invalid GooglePay GatewayMerchantId, GatewayMerchantId in GPay doesn't match with what was on-boarded in MyEway |