If you want to execute a refund from а web page, you`ll need to add this URL to your website.
Example:
<a href="myposapi://glass/1.0?action=com.mypos.transaction.START_TRANSACTION&request_code=102&amount=1.23¤cy=EUR&app_id=yourwebsite.com&app_version=1.0.0&foreign_transaction_id=123test321&callback=https://www.yourwebsite.com/myposglassendpoint">Start myPOS Refund</a>
Method properties
Property |
Typical value |
Type |
Condition |
Description |
---|---|---|---|---|
action | com.mypos.transaction.START_TRANSACTION | String | Mandatory | Action Type: Payment/Refund |
request_code | 101 | Integer | Mandatory | Payment request code. |
amount | 1.23 | Decimal | Mandatory | The amount of the requested payment. |
currency | EUR | String | Mandatory | ISO 3-character currency code. The currency for the payment should be registered and approved. |
app_id | yourwebsite.com | String | Mandatory | Web site domain or application package name. |
app_version | 1.0 | String | Mandatory | Version code of the application. |
tip_amount | 2.20 | Decimal | Optional | Tip amount of the requested payment. |
foreign_transaction_id | 123test321 | String | Optional | Unique transaction id for request/response matching. |
skip_confirmation_screen | true/false | Boolean | Optional | A flag that skips the confirmation screen. |
print_merchant_receipt |
1 2 |
Integer | Optional |
1 - Receipt on 2 - Receipt off |
print_customer_receipt |
1 2 3 4 |
Integer | Optional |
1 - Receipt on 2 - Receipt off 3 - Receipt after confirmation 4 - E - receipt |
receipt_receiver |
+447911123456 |
String | Optional | Set email or phone e-receipt receiver, works with customer receipt configuration RECEIPT_E_RECEIPT or RECEIPT_AFTER_CONFIRMATION |
callback | www.yourwebsite.com/myposglassendpoint | String | Optional | URL that will be executed with response parameters after successful or unsuccessful payment. |
Handle the result
Make sure that the callback URL you provide is correct and controlled by you.
Example of Approved transaction:
{CALLBACK_URL}?status=0&status_text=TRANSACTION_SUCCESS&transaction_approved=true&foreign_transaction_id=123test321&stan=6&date_time=211123172012&authorization_code=074114
Example of Declined transaction:
{CALLBACK_URL}?status=2&status_text=TRANSACTION_DECLINED&transaction_approved=false&foreign_transaction_id=123test321
Response properties
Property |
Typical value |
Type |
Condition |
Description |
---|---|---|---|---|
status | 0 | Integer | Mandatory | One of the constants in the Transaction Processing Result Class |
status_text | TRANSACTION_SUCCESS | String | Mandatory | A textual representation of the status in Transaction Processing Result Class |
transaction_approved | true/false | Boolean | Mandatory | Transaction Status Indicator |
foreign_transaction_id | 123test321 | String | Optional | Unique transaction id for request/response matching |
stan | 27 | Integer | Optional | System Trace Audit Number (unique number of transaction by TID) |
authorization_code | VISSIM | String | Optional | Authorization code returned by issuer |
transfer_date_time | 180129123753 | String | Optional | Date and time of the transaction formatted as YYMMDDHHmmss |