Skip to content

Commit 896217e

Browse files
committed
Add success and failure callback URLs to Simplex API form
1 parent 4509d1f commit 896217e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/api.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,16 @@ export async function sellDetails (sellId) {
305305
}
306306

307307
export const SimplexForm = props => {
308+
const baseUrl = 'https://edge-app-deep-link-redirect.herokuapp.com';
309+
const successUrl = `${baseUrl}?currency=${encodeURI(props.quote.currency)}&digital_amount=${encodeURI(props.quote.fiat_total_amount_amount)}&order_id=${encodeURI(props.quote.payment_id)}`
310+
const failureUrl = `${baseUrl}?dont_track=true`
308311
return (
309312
<form id="payment_form" action={edgeSimplexBuyUrl} method="POST" target="_self">
310313
<input type="hidden" name="version" value={props.quote.version} />
311314
<input type="hidden" name="partner" value={props.quote.partner} />
312315
<input type="hidden" name="payment_flow_type" value={props.quote.payment_flow_type} />
313-
<input type="hidden" name="return_url" value={props.quote.return_url} />
316+
<input type="hidden" name="return_url_success" value={successUrl} />
317+
<input type="hidden" name="return_url_fail" value={failureUrl} />
314318
<input type="hidden" name="quote_id" value={props.quote.quote_id} />
315319
<input type="hidden" name="payment_id" value={props.quote.payment_id} />
316320
<input type="hidden" name="user_id" value={props.quote.user_id} />

src/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// @flow
2-
const SANDBOX = false
2+
const SANDBOX = true
33

44
export const edgeUrl = SANDBOX ? 'https://edge-sandbox.test-simplexcc.com' : 'https://edge-prod.simplex.com'
55

66
export const simplexUrl = SANDBOX ? 'https://sandbox.test-simplexcc.com/payments/new' : 'https://checkout.simplexcc.com/payments/new'
77

8-
export const edgeLegacyBuyUrl = /* SANDBOX ? 'https://simplex-sandbox-api.edgesecure.co' : */'https://simplex-api.edgesecure.co'
9-
export const edgeSimplexBuyUrl = /* SANDBOX ? 'https://sandbox.test-simplexcc.com/payments/new' : */'https://checkout.simplexcc.com/payments/new'
8+
export const edgeLegacyBuyUrl = SANDBOX ? 'https://simplex-sandbox-api.edgesecure.co' : 'https://simplex-api.edgesecure.co'
9+
export const edgeSimplexBuyUrl = SANDBOX ? 'https://sandbox.test-simplexcc.com/payments/new' : 'https://checkout.simplexcc.com/payments/new'

0 commit comments

Comments
 (0)