post https://testapi.payarc.net/v1/charges/google/sale
Create a New Charge
Overview
This endpoint creates a new charge. The information for credit cards is obtained from Google. For more details about the process, please refer to the Google Pay integration section.
Google Pay Integration Scenario
When the merchant is hosting the Google Pay button on their site, the Payarc API expects a Base64 encoded string. For example, if paymentData
is the object provided by Google, Payarc is expecting the result of:
encrypted_data: Buffer.from(JSON.stringify(paymentData.paymentMethodData.tokenizationData.token), 'utf-8').toString('base64')
Error Codes for New Charge Creation
Click to view the error codes associated with new charge creation
When creating a new charge, you may encounter the following error codes. Each status is associated with a specific error message:
Status | Error Message |
---|---|
Activity Limit Exceeded | Activity Limit exceeded |
Bad Request - Try Again | SystemError |
Bad Request - Try Again | System Error (Tran) |
Declined | General Card Auth Decline |
Declined | Do not honor |
Declined | Suspected Card |
Duplicate transaction | Duplicate transaction |
Expired Card | Expired Card |
Host Validation Error | Contact PAYARC - Host Validation Error |
Insufficient Funds | Withdrawal Limit exceeded |
Invalid Amount | Invalid Amount |
Invalid From Account | Contact PAYARC - Invalid From Account |
Invalid Service | Contact PAYARC - Invalid Service |
Possible Duplicate Request | Possible Duplicate Request |
Re-enter transaction | Re-enter transaction |
Transaction Amount Invalid | The value '57679.99999999999' of element 'transactionAmount' is not valid |
New Charge Parameters
Click to view the parameters required to create a new charge
This section describes the parameters required to create a new charge. Each parameter includes its type, format, and specific usage notes.
Parameters
1. Encrypted Data (encrypted_data
)
encrypted_data
)- Type:
string
- Description: Base 64 encoded string coming from the Google object as described in the Google Pay integration section.
- Required: Yes
- Format: Base 64
2. Amount (amount
)
amount
)- Type:
integer
- Description: The amount to charge in cents.
- Required: Yes
- Format: Numeric (in cents)
- Examples:
9
would be$0.09
99999999
would be$999,999.99
3. Currency (currency
)
currency
)- Type:
string
- Description: Three-letter ISO currency code, in lowercase.
- Required: Yes
- Format: Alphabetic
- Allowed Values:
usd
4. Statement Description (statement_description
)
statement_description
)- Type:
string
- Description: An arbitrary string to be displayed on your customer’s credit card statement.
- Required: Optional
- Format: Alphanumeric and Whitespace
- Min Length: 5 characters
- Max Length: 25 characters
- Example:
A1 Company
5. Capture (capture
)
capture
)- Type:
integer
- Description: Option to capture the charge immediately or pre-authorize and capture at a later date.
- Required: Optional
- Format: Boolean
- Default:
1
- Note:
1
represents that the charge has to be captured immediately.0
represents that the charge issues an authorization (or pre-authorization) and will need to be captured later. Uncaptured charges expire in seven days.
6. Email (email
)
email
)- Type:
string
- Description: The cardholder's email address.
- Required: Optional
- Format: Alphanumeric and Special Characters
- Min Length: 5 characters
- Max Length: 40 characters
- Example:
[email protected]
7. Phone Number (phone_number
)
phone_number
)- Type:
integer
- Description: The cardholder's phone number.
- Required: Optional
- Format: Numeric
- Min Length: 2 digits
- Max Length: 11 digits
- Example:
8772036624
8. AVS Parameters (avs_parameters
)
avs_parameters
)- Type:
integer
- Description: AVS transaction parameters that provide post-authorization instructions.
- Required: Optional
- Format: Numeric
- Min Value:
1
- Max Value:
6
- Allowed Values:
1 = If AVS ZIP matches but AVS Street Fails, then void transaction.
2 = If AVS ZIP matches but AVS Street Fails, then do nothing.
3 = If AVS ZIP fails but AVS Street matches, then void transaction.
4 = If AVS ZIP fails but AVS Street matches, then do nothing.
5 = If AVS ZIP fails and AVS Street fails, then void transaction.
6 = If AVS ZIP fails and AVS Street fails, then do nothing.
9. BIN Location Parameters (bin_location_parameters
)
bin_location_parameters
)- Type:
integer
- Description: BIN location transaction parameters that provide post-authorization instructions.
- Required: Optional
- Format: Numeric
- Min Value:
1
- Max Value:
2
- Allowed Values:
1 = If BIN is not equal to USA, then void.
2 = If BIN is not equal to USA and Canada, then void.
10. BIN Card Type Parameters (bin_card_type_parameters
)
bin_card_type_parameters
)- Type:
integer
- Description: BIN card type transaction parameters that provide post-authorization instructions.
- Required: Optional
- Format: Numeric
- Min Value:
1
- Max Value:
4
- Allowed Values:
1 = If BIN is a credit card then void.
2 = If BIN is a debit card then void.
3 = If BIN is a prepaid card then void.
4 = If BIN is a prepaid and/or debit card then void.
11. Address Line 1 (address_line1
)
address_line1
)- Type:
string
- Description: The cardholder's billing address for line 1.
- Required: Optional
- Format: Alphanumeric
- Min Length: 1 character
- Max Length: 200 characters
- Example:
103 Mason Street
12. Address Line 2 (address_line2
)
address_line2
)- Type:
string
- Description: The cardholder's billing address for line 2.
- Required: Optional
- Format: Alphanumeric
- Min Length: 1 character
- Max Length: 200 characters
- Example:
2nd Floor
13. ZIP (zip
)
zip
)- Type:
integer
- Description: The postal code for the address to which the goods are being shipped.
- Required: Optional
- Format: Alphanumeric
- Min Length: 0 digits
- Max Length: 10 digits
- Note: Applicable for
LEVEL2
for AMEX transactions and allLEVEL3
transactions.
14. Metadata (metadata
)
metadata
)- Type:
string
- Description: Metadata is useful for storing additional, structured information on an object. For example, you could store your user’s full name and corresponding unique identifier from your system on a Charge object. You can specify up to 50 keys, with key names up to 20 characters long and values up to 100 characters long. Both keys and values should be strings, and the JSON format should resemble a hash.
- Required: Optional
- Format: JSON
- Max Key Number:
50
- Max Key Length:
20
characters - Max Value Length:
100
characters - Example:
{"FullCustomerName" : "John Smith", "CustomerID" : "1234567890"}
15. Do Not Send Email to Customer (do_not_send_email_to_customer
)
do_not_send_email_to_customer
)- Type:
string
- Description: To prevent sending an email to the customer for a transaction. By default, the system will send an email.
- Required: Optional
- Format: Yes/No
16. Do Not Send SMS to Customer (do_not_send_sms_to_customer
)
do_not_send_sms_to_customer
)- Type:
string
- Description: To prevent sending an SMS to the customer. To prevent sending an SMS, the value must be
yes
. If not present, an SMS will be sent. - Required: Optional
- Format: Yes/No