Skip to content

Commit 8677a3f

Browse files
committed
Resolved issue with large amounts being sent with thousands separator which iATS' API doesn't expect and therefore would incorrectly process.
1 parent a744ac4 commit 8677a3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

includes/give-iats-payment-processing.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* @since 1.0
66
*
77
* @param $donation_data
8+
*
9+
* @return bool
810
*/
911
function give_process_iats_payment( $donation_data ) {
1012

@@ -29,7 +31,7 @@ function give_process_iats_payment( $donation_data ) {
2931
'cvv2' => $donation_data['card_info']['card_cvc'],
3032
'firstName' => $donation_data['post_data']['give_first'],
3133
'lastName' => $donation_data['post_data']['give_last'],
32-
'total' => $donation_data['post_data']['give-amount'],
34+
'total' => give_sanitize_amount( $donation_data['post_data']['give-amount'], give_get_price_decimals()),
3335
'comment' => 'givewp',
3436
'currency' => give_get_currency(),
3537
'mop' => give_iats_get_card_name_by_type( $card['type'] ),
@@ -113,8 +115,10 @@ function give_process_iats_payment( $donation_data ) {
113115
update_post_meta( $payment, '_iats_donation_response', $response );
114116
update_post_meta( $payment, '_iats_mop', give_iats_get_card_name_by_type( $card['type'] ) );
115117

116-
// Send to success page.9
118+
// Send to success page.
117119
give_send_to_success_page();
120+
121+
return true;
118122
}
119123

120124
add_action( 'give_gateway_iats', 'give_process_iats_payment' );

0 commit comments

Comments
 (0)