Skip to content

Instantly share code, notes, and snippets.

@PontusNyberg
Created February 5, 2019 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PontusNyberg/40bc568d6ec0b7eadc51ecbc01b115c9 to your computer and use it in GitHub Desktop.
Save PontusNyberg/40bc568d6ec0b7eadc51ecbc01b115c9 to your computer and use it in GitHub Desktop.
fetch('https://api.mondido.com/v1/transactions?locale=eng', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
'Authorization': basicAuth
},
body: qs.stringify({
process: false,
amount: amount,
currency: currency,
payment_ref: paymentRef,
customer_ref: customerRef,
hash: transHash,
webhooks: [
{
id: 1,
created_at: Date.now(),
type: "CustomHttp",
response: {
"code": 200,
"body": "Success",
"message": "Payment success",
"error": "Payment could not be fulfilled"
},
http_method: "POST",
email: "",
url: "www.nyberg.xyz",
trigger: "payment_success",
data_format: "JSON"
}
],
test: true,
success_url: "https://paymentstatus.mondido.com/payment-ok",
error_url: "https://paymentstatus.mondido.com/payment-error",
card_expiry: "9999",
card_cvv: "200",
metadata: {
products: [
{
id: 1,
name: "express",
price: "995.00",
qty: "1"
}
]
}
})
})
@PontusNyberg
Copy link
Author

Svaret jag får är följande:
amount: "995.0"
authorize: false
captures: []
card_holder: null
card_number: null
card_type: null
client_info: {raw_user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWeb…ML, like Gecko) Chrome/71.0.3578.98 Safari/537.36", browser: "Chrome", version: "71.0.3578.98", platform: "Windows", ip: "162.158.182.167", …}
cost: {id: null, percentual_fee: "0.0", fixed_fee: "0.0", percentual_exchange_fee: "0.0", vat_rate: "0.0", …}
created_at: "2019-02-05T10:08:11.522Z"
currency: "sek"
currency_converter: null
customer: {id: 249605}
customer_name: null
dynamic_webhooks: {}
error: null
error_url: "https://paymentstatus.mondido.com/payment-error"
event_context: {internal: {…}}
fail_message: ""
href: "https://pay.mondido.com/v1/form/x2ZsTXvzZaHWw33ZezMVGw"
id: 1117993
items: null
link_payment: false
log_events: [{…}]
merchant_id: 5206
metadata: {products: {…}, variables: {…}}
mpi_ref: null
org_auth_amount: 995
payment_details: {id: 1384842, card_number: null, card_holder: null, card_type: null, customer_number: null, …}
payment_ref: "ref42"
payment_response: {}
processed_at: null
ref: null
refunds: []
request_hash: "cf14731159f3a3ee89c1a66c9f307360"
response_hash: "63342f23d1fbffa64c3855fd707741a5"
status: "pending"
status_details: ""
stored_card: null
subscription: null
success_url: "https://paymentstatus.mondido.com/payment-ok"
template_id: null
test: true
transaction_type: null
vat_amount: "0.0"
wallet_type: null
webhooks: Array(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment