Skip to content

Commit

Permalink
Merge pull request #61 from xendit/CC-7788/update-zero-amount-validation
Browse files Browse the repository at this point in the history
[CC-7788] Update zero amount validation
  • Loading branch information
andysg012 authored Jan 19, 2023
2 parents 87787cf + 21456f9 commit 101b077
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Xendit/XDTCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ public class XDTCards: CanTokenize, CanAuthenticate {

if (tokenizationRequest.isSingleUse) {
if (tokenizationRequest.amount != nil) {
guard tokenizationRequest.amount!.doubleValue > 0 else {
return XenditError(errorCode: "VALIDATION_ERROR", message: "Amount must be a number greater than 0")
guard tokenizationRequest.amount!.doubleValue >= 0 else {
return XenditError(errorCode: "VALIDATION_ERROR", message: "Amount must not be less than 0")
}
} else {
return XenditError(errorCode: "VALIDATION_ERROR", message: "Amount is required for single use token")
Expand Down
2 changes: 1 addition & 1 deletion Xendit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Xendit'
s.version = '3.7.0'
s.version = '3.7.1'
s.license = 'MIT'
s.homepage = 'https://www.xendit.co'
s.author = { 'Juan Gonzalez’' => '[email protected]' }
Expand Down

0 comments on commit 101b077

Please sign in to comment.