@@ -969,7 +969,7 @@ public function do_capture()
969
969
$ this ->Response = $ this ->hash_call ("DoCapture " , $ nvpstr );
970
970
971
971
// Format our response and return the outcome
972
- return $ this ->format_response ();
972
+ return $ this ->format_response (' DoCapture ' );
973
973
}
974
974
975
975
public function do_authorization ()
@@ -990,7 +990,7 @@ public function do_authorization()
990
990
$ this ->Response = $ this ->hash_call ("DoAuthorization " , $ nvpstr );
991
991
992
992
// Format our response and return the outcome
993
- return $ this ->format_response ();
993
+ return $ this ->format_response (' DoAuthorization ' );
994
994
}
995
995
996
996
public function do_reauthorization ()
@@ -1011,7 +1011,7 @@ public function do_reauthorization()
1011
1011
$ this ->Response = $ this ->hash_call ("DoReauthorization " , $ nvpstr );
1012
1012
1013
1013
// Format our response and return the outcome
1014
- return $ this ->format_response ();
1014
+ return $ this ->format_response (' DoReauthorization ' );
1015
1015
}
1016
1016
1017
1017
public function do_void ()
@@ -1032,7 +1032,7 @@ public function do_void()
1032
1032
$ this ->Response = $ this ->hash_call ("DoVoid " , $ nvpstr );
1033
1033
1034
1034
// Format our response and return the outcome
1035
- return $ this ->format_response ();
1035
+ return $ this ->format_response (' DoVoid ' );
1036
1036
}
1037
1037
1038
1038
public function do_direct_payment ()
@@ -1083,7 +1083,7 @@ public function do_direct_payment()
1083
1083
$ this ->Response = $ this ->hash_call ("DoDirectPayment " , $ nvpstr );
1084
1084
1085
1085
// Format our response and return the outcome
1086
- return $ this ->format_response ();
1086
+ return $ this ->format_response (' DoDirectPayment ' );
1087
1087
}
1088
1088
1089
1089
public function set_express_checkout ()
@@ -1110,7 +1110,7 @@ public function set_express_checkout()
1110
1110
$ this ->Response = $ this ->hash_call ("SetExpressCheckout " , $ nvpstr );
1111
1111
1112
1112
// Format our response and return the outcome
1113
- return $ this ->format_response ();
1113
+ return $ this ->format_response (' SetExpressCheckout ' );
1114
1114
}
1115
1115
1116
1116
public function set_express_checkout_successful_redirect ()
@@ -1149,7 +1149,7 @@ public function get_express_checkout_details()
1149
1149
$ this ->Response = $ this ->hash_call ("GetExpressCheckoutDetails " , $ nvpstr );
1150
1150
1151
1151
// Format our response and return the outcome
1152
- return $ this ->format_response ();
1152
+ return $ this ->format_response (' GetExpressCheckoutDetails ' );
1153
1153
}
1154
1154
1155
1155
public function do_express_checkout_payment ()
@@ -1196,7 +1196,7 @@ public function do_express_checkout_payment()
1196
1196
$ this ->urldecodeVariables ();
1197
1197
1198
1198
// Format our response and return the outcome
1199
- return $ this ->format_response ();
1199
+ return $ this ->format_response (' DoExpressCheckoutPayment ' );
1200
1200
}
1201
1201
1202
1202
public function get_transaction_details ()
@@ -1212,7 +1212,7 @@ public function get_transaction_details()
1212
1212
$ this ->Response = $ this ->hash_call ("GetTransactionDetails " , $ nvpstr );
1213
1213
1214
1214
// Format our response and return the outcome
1215
- return $ this ->format_response ();
1215
+ return $ this ->format_response (' GetTransactionDetails ' );
1216
1216
}
1217
1217
1218
1218
public function refund_transaction ()
@@ -1228,7 +1228,7 @@ public function refund_transaction()
1228
1228
$ this ->Response = $ this ->hash_call ("RefundTransaction " , $ nvpstr );
1229
1229
1230
1230
// Format our response and return the outcome
1231
- return $ this ->format_response ();
1231
+ return $ this ->format_response (' RefundTransaction ' );
1232
1232
}
1233
1233
1234
1234
public function create_recurring_payments_profile ()
@@ -1243,7 +1243,7 @@ public function create_recurring_payments_profile()
1243
1243
$ this ->urldecodeVariables ();
1244
1244
1245
1245
// Format our response and return the outcome
1246
- return $ this ->format_response ();
1246
+ return $ this ->format_response (' CreateRecurringPaymentsProfile ' );
1247
1247
}
1248
1248
1249
1249
public function get_recurring_payments_profile_details ()
@@ -1254,7 +1254,7 @@ public function get_recurring_payments_profile_details()
1254
1254
$ this ->Response = $ this ->hash_call ("GetRecurringPaymentsProfileDetails " , $ nvpstr );
1255
1255
1256
1256
// Format our response and return the outcome
1257
- return $ this ->format_response ();
1257
+ return $ this ->format_response (' GetRecurringPaymentsProfileDetails ' );
1258
1258
}
1259
1259
1260
1260
public function update_recurring_payments_profile ()
@@ -1268,7 +1268,7 @@ public function update_recurring_payments_profile()
1268
1268
$ this ->Response = $ this ->hash_call ("UpdateRecurringPaymentsProfile " , $ nvpstr );
1269
1269
1270
1270
// Format our response and return the outcome
1271
- return $ this ->format_response ();
1271
+ return $ this ->format_response (' UpdateRecurringPaymentsProfile ' );
1272
1272
}
1273
1273
1274
1274
public function manage_recurring_payments_profile_status ()
@@ -1282,7 +1282,7 @@ public function manage_recurring_payments_profile_status()
1282
1282
$ this ->Response = $ this ->hash_call ("ManageRecurringPaymentsProfileStatus " , $ nvpstr );
1283
1283
1284
1284
// Format our response and return the outcome
1285
- return $ this ->format_response ();
1285
+ return $ this ->format_response (' ManageRecurringPaymentsProfileStatus ' );
1286
1286
}
1287
1287
1288
1288
public function do_reference_transaction ()
@@ -1333,7 +1333,7 @@ public function do_reference_transaction()
1333
1333
$ this ->Response = $ this ->hash_call ("DoReferenceTransaction " , $ nvpstr );
1334
1334
1335
1335
// Format our response and return the outcome
1336
- return $ this ->format_response ();
1336
+ return $ this ->format_response (' DoReferenceTransaction ' );
1337
1337
}
1338
1338
1339
1339
/**
@@ -1644,7 +1644,7 @@ private function urldecodeVariables()
1644
1644
}
1645
1645
1646
1646
// We take our response and depending on whether it's a success or failure, set our values accordingly
1647
- private function format_response ()
1647
+ private function format_response ($ response_type )
1648
1648
{
1649
1649
if (strtoupper ($ this ->Response ["ACK " ]) != "SUCCESS " AND strtoupper ($ this ->Response ["ACK " ]) != "SUCCESSWITHWARNING " )
1650
1650
{
@@ -1682,7 +1682,7 @@ private function format_response()
1682
1682
elseif (strtoupper ($ this ->Response ["ACK " ]) == 'SUCCESS ' OR strtoupper ($ this ->Response ["ACK " ]) == 'SUCCESSWITHWARNING ' )
1683
1683
{
1684
1684
/* Take the response variables and put them into the local class variables */
1685
- foreach ($ this ->ResponseFieldsArray [' DoReferenceTransaction ' ] as $ key => $ value )
1685
+ foreach ($ this ->ResponseFieldsArray [$ response_type ] as $ key => $ value )
1686
1686
$ this ->$ key = $ this ->Response [$ value ];
1687
1687
1688
1688
return true ;
0 commit comments