-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
269 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>HPP Lightbox Demo</title> | ||
<meta charset="UTF-8"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | ||
<script src="/dist/rxp-js.js"></script> | ||
<script> | ||
RealexHpp.setHppUrl('https://pay.sandbox.realexpayments.com/pay'); | ||
// get the HPP JSON from the server-side SDK | ||
$(document).ready(function () { | ||
$.getJSON("/examples/hpp/proxy-request.php?slug=process-a-payment", function (jsonFromServerSdk) { | ||
RealexHpp.embedded.init( | ||
"payButtonId", | ||
"targetIframe", | ||
"https://dev.rlxcarts.com/mobileSDKsV2/response.php", | ||
jsonFromServerSdk | ||
); | ||
$('body').addClass('loaded'); | ||
}); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<input type="submit" id="payButtonId" value="Checkout Now" /> | ||
<br /> | ||
<iframe id="targetIframe" style="display:none;"></iframe> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
define(function (require) { | ||
var bdd = require('intern!bdd'); | ||
var assert = require('intern/chai!assert'); | ||
var successHelper = require('intern/dojo/node!../../helpers/hpp').iframeSuccessHelper; | ||
|
||
bdd.describe('RealexRemote - HPP Embedded Positive Tests', function () { | ||
bdd.it('should process a payment successfully', | ||
successHelper( | ||
// url | ||
require.toUrl('http://localhost:8989/examples/hpp/process-a-payment-embedded.html'), | ||
// iframe selector | ||
'#targetIframe', | ||
// fields to enter | ||
[ | ||
{ name: 'pas_ccnum', type: 'text', value: '4111111111111111' }, | ||
{ name: 'pas_expiry', type: 'text', value: '1225' }, | ||
{ name: 'pas_cccvc', type: 'text', value: '012' }, | ||
{ name: 'pas_ccname', type: 'text', value: 'Jane Doe' }, | ||
], | ||
// callback to assert against result | ||
function (command) { | ||
return command | ||
.execute(() => document.body.innerText) | ||
.then(function (text) { | ||
// make our assertions on the HPP response | ||
var json = JSON.parse(text); | ||
json = JSON.parse(json.response); | ||
assert.isOk(json.AUTHCODE); | ||
}) | ||
.end(); | ||
} | ||
).bind(this) | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.