paymentsjs-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c45d3ca2b2f6c28e6416ee706a8e41f52f6bd605
|
4
|
+
data.tar.gz: d31208d4f915e551f353a730d066b8adb8361eb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6c92da4b4860c60505b040baa493490a34f4a0714c58d53e09d97e4be903dfeb18960229a815dd9e4c296d85e75f5ccaf413dc7258b1cc0b2d498f923bfdc4d
|
7
|
+
data.tar.gz: 073af2bf43a713205e588429cd9bae6881370a6d8e4545ad342659aa9467640b3d30f1af33e98b0dc950cbb0c382beaeefdc9477d8e1e53f6ba9a106c5a89b8a
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Sage PaymentsJS-Rails Gem
|
2
2
|
|
3
|
+
####NOTE: This gem is not yet finished and has not been extensively tested, be very careful using this gem until v.1.0 is released.
|
4
|
+
|
3
5
|
The PaymentsJS-Rails gem simplifies the integration of Sage's PaymentsJS SDK by adding the PaymentsJs model and making configuring environmental variables easy.
|
4
6
|
|
5
7
|
##Installation
|
@@ -32,23 +34,31 @@ Follow the [PaymentsJS GitHub Quick Start guide](https://github.com/SagePayments
|
|
32
34
|
```
|
33
35
|
part.
|
34
36
|
|
35
|
-
PaymentsJS requires several variables to be added to the `$UI.Initialize()` function in order to work. The Quick Start comes with several variables preloaded. We'll replace these with embedded ruby
|
37
|
+
PaymentsJS requires several variables to be added to the `$UI.Initialize()` function in order to work. The Quick Start comes with several variables preloaded. We'll replace these with embedded ruby to call the same preloaded variables:
|
36
38
|
|
37
39
|
```javascript
|
38
40
|
PayJS(['PayJS/UI'], // the name of the module we want to use
|
39
41
|
function($UI) { // assigning the module to a variable
|
40
42
|
$UI.Initialize({ // configuring the UI
|
41
43
|
apiKey: "<%= PaymentJs.api_key %>", // your developer ID
|
42
|
-
merchantId: "<%=
|
43
|
-
authKey: "<%=
|
44
|
-
requestType: "<%=
|
45
|
-
requestId: "<%=
|
46
|
-
amount: "<%=
|
44
|
+
merchantId: "<%= PaymentsJs.mid %>", // your 12-digit account identifier
|
45
|
+
authKey: "<%= PaymentsJs.encrypt %>", // covered in the next section!
|
46
|
+
requestType: "<%= PaymentsJs.request_type %>", // use can use "vault" to tokenize a card without charging it
|
47
|
+
requestId: "<%= PaymentsJs.req_id %>", // an order number, customer or account identifier, etc.
|
48
|
+
amount: "<%= PaymentsJs.amount %>", // the amount to charge the card. in test mode, different amounts produce different results.
|
47
49
|
elementId: "paymentButton", // the page element that will trigger the UI
|
48
|
-
nonce: "<%=
|
50
|
+
nonce: "<%= PaymentsJs.salt %>", // a unique identifier, used as salt
|
49
51
|
debug: true, // enables verbose console logging
|
50
|
-
preAuth: <%=
|
51
|
-
environment: "<%=
|
52
|
+
preAuth: <%= PaymentsJs.pre_auth %>, // run a Sale, rather than a PreAuth
|
53
|
+
environment: "<%= PaymentsJs.environment %>", // hit the certification environment
|
54
|
+
addFakeData: true,
|
55
|
+
billing: {
|
56
|
+
name: "Shaka Smart",
|
57
|
+
address: "",
|
58
|
+
City: "Denver",
|
59
|
+
state: "CO",
|
60
|
+
postalCode: "80205"
|
61
|
+
}
|
52
62
|
});
|
53
63
|
$UI.setCallback(function(result) { // custom code that will execute when the UI receives a response
|
54
64
|
console.log(result.getResponse()); // log the result to the console
|
@@ -84,6 +94,4 @@ PaymentsJs.request_type = "ORDER REQUEST TYPE"
|
|
84
94
|
PaymentsJs.pre_auth = boolean
|
85
95
|
PaymentsJs.environment = "ORDER ENVIRONMENT"
|
86
96
|
```
|
87
|
-
The other variables are generated by encryption.
|
88
|
-
|
89
|
-
####NOTE: This gem is not yet finished and has not been extensively tested, be very careful using this gem until v.1.0 is released.
|
97
|
+
The other variables are generated by encryption.
|