poundpay 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. data/.gitmodules +3 -0
  2. data/README.rdoc +75 -0
  3. data/examples/{simple_application → marketplace}/.gems +0 -0
  4. data/examples/{simple_application → marketplace}/.rvmrc +0 -0
  5. data/examples/{simple_application → marketplace}/README +0 -0
  6. data/examples/{simple_application → marketplace}/application.rb +51 -36
  7. data/examples/{simple_application → marketplace}/config.rb +2 -2
  8. data/examples/{simple_application → marketplace}/config.ru +1 -1
  9. data/examples/{simple_application → marketplace}/index.html.erb +0 -0
  10. data/lib/poundpay/elements.rb +6 -0
  11. data/lib/poundpay/resource.rb +17 -5
  12. data/lib/poundpay/version.rb +1 -1
  13. data/spec/poundpay/resource_spec.rb +10 -0
  14. metadata +50 -90
  15. data/examples/simple_application/static/css/simplemp.css +0 -13
  16. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  17. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  18. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  19. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  20. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  21. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  22. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  23. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  24. data/examples/simple_application/static/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  25. data/examples/simple_application/static/css/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  26. data/examples/simple_application/static/css/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  27. data/examples/simple_application/static/css/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  28. data/examples/simple_application/static/css/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  29. data/examples/simple_application/static/css/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  30. data/examples/simple_application/static/css/ui-lightness/jquery-ui-1.8.13.custom.css +0 -578
  31. data/examples/simple_application/static/favicon.ico +0 -0
  32. data/examples/simple_application/static/js/jquery-1.6.1.js +0 -8936
  33. data/examples/simple_application/static/js/jquery-ui-1.8.13.custom.min.js +0 -784
  34. data/examples/simple_application/static/js/simplemp.js +0 -177
@@ -1,177 +0,0 @@
1
- function createChargePermission () {
2
- var args = {};
3
- var inputs = $('#chargePermissionTable input').each(function(i, item) {
4
- args[item.id] = item.value;
5
- });
6
- var request = {};
7
- request.url = "charge_permission";
8
- request.type = "POST";
9
- request.data = $.param(args);
10
- request.success = function(data) {
11
- $('#charge_permission_id').val(data);
12
- $('#operating_charge_permission_sid').val(data);
13
- };
14
- $.ajax(request);
15
- }
16
-
17
- function findChargePermission () {
18
- var args = {};
19
- args.email_address = $('#email_address').val()
20
- var request = {};
21
- request.url = "charge_permission/find";
22
- request.type = "POST";
23
- request.data = $.param(args);
24
- request.success = function(data) {
25
- $('#find_charge_permission_results').html(data);
26
- };
27
- request.error = function() {
28
- $('#find_charge_permission_results').html('');
29
- };
30
- $.ajax(request);
31
- }
32
-
33
- function deactivateChargePermission () {
34
- var args = {};
35
- args.sid = $('#charge_permission_id').val()
36
- var request = {};
37
- request.url = "charge_permission/deactivate";
38
- request.type = "POST";
39
- request.data = $.param(args);
40
- $.ajax(request);
41
- }
42
-
43
- function startChargePermissionIFrame() {
44
- // invoke charge permission iframe
45
- var args = {
46
- success: chargePermissionSuccessCallback,
47
- error: chargePermissionErrorCallback,
48
- charge_permission_sid: $('#charge_permission_id').val(),
49
- server: $('#charge_permission_server').val(),
50
- name: $('#charge_permission_cardholder_name').val(),
51
- address_street: '',
52
- address_city: '',
53
- address_state: '',
54
- address_zip: '',
55
- poundroot_id: 'pound-pcp'
56
- };
57
- PoundPay.init(args);
58
- }
59
-
60
- function chargePermissionSuccessCallback() {
61
- $("#pound-pcp").hide();
62
- $('#chargePermissionComplete').show();
63
- }
64
-
65
- function chargePermissionErrorCallback() {
66
- $("#pound-pcp").hide();
67
- alert("an error occurred");
68
- }
69
-
70
- function createPayment () {
71
- var args = {};
72
- var inputs = $('#paymentsTable input').each(function(i, item) {
73
- args[item.id] = item.value;
74
- });
75
- var request = {};
76
- request.url = "payment";
77
- request.type = "POST";
78
- request.data = $.param(args);
79
- request.success = function(data) {
80
- $('#payment_id').val(data);
81
- $('#operating_payment_sid').val(data);
82
- };
83
- $.ajax(request);
84
- }
85
-
86
- function createUser () {
87
- var args = {};
88
- var inputs = $('#create_user_table input').each(function(i, item) {
89
- args[item.id] = item.value;
90
- });
91
- var request = {};
92
- request.url = "user";
93
- request.type = "POST";
94
- request.data = $.param(args);
95
- request.success = function(data) {
96
- $('#created_user_results').append(data);
97
- };
98
- $.ajax(request);
99
- }
100
-
101
- function authorizePayment () {
102
- var args = {};
103
- args.sid = $('#operating_payment_sid').val()
104
- var request = {};
105
- request.url = "payment/authorize";
106
- request.type = "POST";
107
- request.data = $.param(args);
108
- request.success = function(data) {
109
- $('#operation_results').append(data);
110
- };
111
- $.ajax(request);
112
- }
113
-
114
- function escrowPayment () {
115
- var args = {};
116
- args.sid = $('#operating_payment_sid').val()
117
- var request = {};
118
- request.url = "payment/escrow";
119
- request.type = "POST";
120
- request.data = $.param(args);
121
- request.success = function(data) {
122
- $('#operation_results').append(data);
123
- };
124
- $.ajax(request);
125
- }
126
-
127
- function releasePayment () {
128
- var args = {};
129
- args.sid = $('#operating_payment_sid').val()
130
- var request = {};
131
- request.url = "payment/release";
132
- request.type = "POST";
133
- request.data = $.param(args);
134
- request.success = function(data) {
135
- $('#operation_results').append(data);
136
- };
137
- $.ajax(request);
138
- }
139
-
140
- function cancelPayment () {
141
- var args = {};
142
- args.sid = $('#operating_payment_sid').val()
143
- var request = {};
144
- request.url = "payment/cancel";
145
- request.type = "POST";
146
- request.data = $.param(args);
147
- request.success = function(data) {
148
- $('#operation_results').append(data);
149
- };
150
- $.ajax(request);
151
- }
152
-
153
- function startIFrame() {
154
- // invoke Pound iframe
155
- var args = {
156
- success: paymentSuccessCallback,
157
- error: paymentErrorCallback,
158
- payment_sid: $('#payment_id').val(),
159
- server: $('#server').val(),
160
- name: $('#cardholder_name').val(),
161
- address_street: '',
162
- address_city: '',
163
- address_state: '',
164
- address_zip: ''
165
- };
166
- PoundPay.init(args);
167
- }
168
-
169
- function paymentSuccessCallback() {
170
- $("#pound-root").hide();
171
- $('#paymentComplete').show();
172
- }
173
-
174
- function paymentErrorCallback() {
175
- $("#pound-root").hide();
176
- alert("an error occurred");
177
- }