Stored Card Payment Request (UI)
Once the My2c2p Payment Request with UI is executed, my2c2p payment form will be displayed. You are able to customize the layout to suit your application, see the Custom UI for detail.
To request storecard payment , you need to init the property like below
- (void)payment {
//set mandatory fields
paymentSDK.merchantID = @"JT01";
paymentSDK.uniqueTransactionCode = @"123456789";
paymentSDK.desc = @"production item 1";
paymentSDK.amount = 10.00;
paymentSDK.currencyCode = @"702";
paymentSDK.secretKey = @"123456";
paymentSDK.storeCardUniqueID = @"123456789";
paymentSDK.paymentUI = YES;
//optionals
paymentSDK.useStoredCardOnly = true;
[paymentSDK requestWithTarget:self onResponse:^(NSDictionary *response)
{
NSLog(@"%@",response);
if([response[@"respCode"] isEqualToString:@"00"])
{
message = @"Payment Success";
}
else {
message = response[@"failReason"];
}
NSLog(@"Payment status: %@",message);
} onFail:^(NSError *error) {
if(error) {
NSLog(@"%@",error);
}
else {
NSLog(@"Cancel The Payment From OTP");
}
}];
}
func payment() {
//set mandatory fields
paymentSDK.merchantID = "JT01"
paymentSDK.uniqueTransactionCode = "123456789"
paymentSDK.desc = "production item 1"
paymentSDK.amount = 10.00
paymentSDK.currencyCode = "702"
paymentSDK.secretKey = "123456"
paymentSDK.storeCardUniqueID = "123456789"
paymentSDK.paymentUI = true
//optionals
paymentSDK.useStoredCardOnly = true
paymentSDK.request(withTarget: self, onResponse: { (response) in
print("response: \(String(describing: response))")
}) { (error) in
if error != nil {
print("error: \(String(describing: error?.localizedDescription))")
}else{
print("user cancel payment")
}
}
}
Check the full Payment Request example and response at Response Dictionary.