Payment Service
Features
-
Supports 100+ payment providers. (Full List)
-
Utilizes Active Merchant as the underlying platform.
-
Exposes a gRPC interface for handling payment specific functionality.
-
Supports both authorization and purchase style payment flows.
Configuration
Purchase flow
The purchase flow is the simpler option.
It goes through the following steps:
-
Setup the purchase flow (
SetupPurchase
method) -
User redirection to the payment platform page
-
After user returns from payment platform, complete the payment (
Purchase
method)
It does not require a checkout or approval page on the store page.
Authorization Flow
The authorization flow utilizes the option that after returning from the payment platform the user can do a final review of the invoice before it gets approved.
It goes through the following steps:
-
Setup the authorization flow (
SetupAuthorization
method) -
User redirection to the payment platform page
-
After user returns from payment platform, approve the authorization (
Authorize
method) -
Show the full invoice with an approval button to the user.
-
After user has approved, complete the payment (
Capture
method)
API
This microservice exposes the following gRPC endpoints:
Payment
A Payment resource.
io.restorecommerce.payment.SetupRequest
Sent to the service to initiate a new payment transaction
Field | Type | Label | Description |
---|---|---|---|
ip |
string |
required |
IP of the client initiating the payment |
items |
[] |
required |
List of items to be paid for |
subtotal |
int32 |
required |
The subtotal of all items |
shipping |
int32 |
required |
The cost of shipping |
handling |
int32 |
required |
The cost of handling |
tax |
int32 |
required |
The applied tax amount |
currency |
string |
required |
The currency of the transaction |
return_url |
string |
required |
The URL the client will be returned to after a successful payment |
cancel_return_url |
string |
required |
The URL the client will be returned to after a failed payment |
allow_guest_checkout |
bool |
required |
Whether the payment platform should allow non-registered members to complete the payment |
provider |
|
required |
The payment provider used for this transaction |
io.restorecommerce.payment.SetupResponse
Sent as a response to io.restorecommerce.payment.SetupRequest
with either success or failure
Field | Type | Label | Description |
---|---|---|---|
payment_errors |
[] |
required |
A list of errors that occurred during setup |
token |
string |
required |
The token for this transaction |
confirm_initiation_url |
string |
required |
The URL the client needs to visit to complete this transaction |
initiated_on |
string |
required |
The date and time of the initiation of this transaction |
io.restorecommerce.payment.PaymentRequest
Sent to the service to either authorize the transaction or complete the purchase flow
Field | Type | Label | Description |
---|---|---|---|
provider |
|
required |
The payment provider used for this transaction |
payment_sum |
int32 |
required |
The total sum of the transaction |
currency |
string |
required |
The currency of the transaction |
payment_id |
string |
required |
The ID of the transaction |
payer_id |
string |
required |
The ID of the client that has confirmed the transaction |
token |
string |
required |
The token for this transaction |
io.restorecommerce.payment.CaptureRequest
Sent to the service to complete the authorization flow
Field | Type | Label | Description |
---|---|---|---|
provider |
|
required |
The payment provider used for this transaction |
payment_sum |
int32 |
required |
The total sum of the transaction |
currency |
string |
required |
The currency of the transaction |
payment_id |
string |
required |
The ID of the transaction |
io.restorecommerce.payment.PaymentResponse
Sent as a response to io.restorecommerce.payment.PaymentResponse
or io.restorecommerce.payment.CaptureRequest
with either success or failure
Field | Type | Label | Description |
---|---|---|---|
payment_errors |
[] |
required |
A list of errors that occurred during setup |
payment_id |
string |
required |
The ID of the transaction |
executed_on |
string |
required |
The date and time of the execution of this transaction |
io.restorecommerce.payment.Item
Field | Type | Label | Description |
---|---|---|---|
name |
string |
required |
The name of this item |
description |
string |
required |
The description of this item |
quantity |
int32 |
required |
The quantity of the item |
amount |
int32 |
required |
The price of a single item |
io.restorecommerce.payment.PaymentError
Field | Type | Label | Description |
---|---|---|---|
killed |
boolean |
required |
Whether the payment process was killed |
code |
int32 |
required |
The exit code of the payment process |
signal |
string |
required |
??? |
cmd |
string |
required |
The command executed for the payment |
stdout |
string |
required |
The stdout of the command |
stderr |
string |
required |
The stderr of the command |
io.restorecommerce.payment.Provider
Field | Value | Description |
---|---|---|
NO_PROVIDER |
0 |
Do not use a payment provider |
PaypalExpressGateway |
1 |
Use PayPal Express payment provider |
AuthorizeNetGateway |
2 |
Use Authorize.Net payment provider |
CRUD Operations
The microservice exposes the below CRUD operations for creating or modifying Payment resources.
io.restorecommerce.payment.Service
Method Name | Request Type | Response Type | Description |
---|---|---|---|
SetupAuthorization |
|
|
Setup a new authorization flow style payment |
SetupPurchase |
|
|
Setup a new payment flow style payment |
Authorize |
|
|
Authorize a payment to be captured |
Purchase |
|
|
Complete a purchase |
Capture |
|
|
Capture an authorized payment |