AppotaPayment

Inherits from: NSObject
Declared in: AppotaPayment.h

Tổng quan

AppotaPayment là class thực thi tất cả các chức năng chính của Payment SDK. Class này cung cấp các hàm gọi đến các giao diện thanh toán cho từng hình thức khác nhau.

Thuộc tính

BOOL isSandBoxMode Tùy chọn bật/tắt chế độ sandbox cho ứng dụng
NSString *clientID Mã clientID được hệ thống Appota cung cấp cho ứng dụng
NSString *clientSecret Chuỗi clientSecret được hệ thống Appota cung cấp cho ứng dụng
NSString *sandboxKey Chuối sandboxKey được hệ thống Appota cung cấp cho ứng dụng
NSString *inappKey Chuỗi inappKey được hệ thống Appota cung cấp cho ứng dụng
BOOL debugMode Tùy chọn bật/tắt chế độ debug

Kiểu định nghĩa

AppotaPaymentHandler

Được truyền vào khi gọi các phương thức thanh toán để nhận dữ liệu khi quá trình khởi tạo giao dịch kết thúc.

typedef void(^AppotaPaymentHandler)(NSDictionary *apiDict, AppotaPaymentState status, NSError *error);

AppotaPaymentState

Các giá trị trạng thái giao dịch được trả về khi quá trình khởi tạo giao dịch kết thúc.

typedef enum {
    AppotaPaymentSucceed = 1,
    AppotaPaymentFailed = 0,
    AppotaPaymentSMSPending = 2,
    AppotaPaymentSMSCanceled = 3,
    AppotaPaymentSMSInValidAmount = 4,
    AppotaPaymentClosed = 5,
    AppotaPaymentCardInvalid = 6,
    AppotaPaymentInvalidAmount = 7,
    AppotaGetListSMSError = 11,
    AppotaPaymentWrongFormatResponse = 12,
} AppotaPaymentState;

Phương thức

void makeSMSPaymentWithAmount:(int) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức SMS với giá tiền cho trước.
void makeSMSPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức SMS với danh sách giá tiền cho trước.
void makeSMSPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Lấy cú pháp tin nhắn từ hệ thống (dành cho những ứng dụng tự thiết kế giao diện thanh toán, không sử dụng giao diện hiển thị của Appota SDK).
void makePaypalPaymentWithAmount:(float) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức Paypal với giá tiền cho trước.
void makePaypalPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức Paypal với danh sách giá tiền cho trước.
void makePaypalPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức Paypal cho phép người dùng nhập số tiền.
void makeCardPaymentWithCardCode:(NSString *)cardCode withCardSerial:(NSString *)cardSerial withCardVendor:(NSString *)cardVendor withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler
Thanh toán bằng thẻ cào trực tiếp (dành cho những ứng dụng tự thiết kế giao diện thanh toán, không sử dụng giao diện hiển thị của Appota SDK).
void makeCardPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức thẻ cào.
void makeBankPaymentWithAmount:(float) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức internet banking với giá tiền cho trước.
void makeBankPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức internet banking với danh sách giá tiền cho trước.
void makeBankPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức internet banking cho phép người dùng tự nhập số tiền.
void makeApplePaymentWithItem:(AppotaAppleIAPItem*) item withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức Apple Payment với một IAP item cho trước.
void makeApplePaymentWithListItem:(NSArray*) lisItem withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler
Hiển thị giao diện thanh toán sử dụng phương thức Apple Payment với danh sách IAP item cho trước.
void checkTransactionInAppWithID:(NSString *)inApp_id withCompletionHandler:(AppotaResultHandler) handler
void checkUpdate

 

(void) makeSMSPaymentWithAmount:(int) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức SMS với giá tiền cho trước.

Parameters:

- amount: Giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeSMSPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức SMS với danh sách giá tiền cho trước.

Parameters:

- listAmount: Danh sách giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeSMSPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Lấy cú pháp tin nhắn từ hệ thống (dành cho những ứng dụng tự thiết kế giao diện thanh toán, không sử dụng giao diện hiển thị của Appota SDK).

Parameters:

- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makePaypalPaymentWithAmount:(float) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức Paypal với giá tiền cho trước.

Parameters:

- amount: Giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makePaypalPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức Paypal với danh sách giá tiền cho trước.

Parameters:

- listAmount: Danh sách giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makePaypalPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức Paypal cho phép người dùng nhập số tiền.

Parameters:

- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeCardPaymentWithCardCode:(NSString *)cardCode withCardSerial:(NSString *)cardSerial withCardVendor:(NSString *)cardVendor withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler

Thanh toán bằng thẻ cào trực tiếp (dành cho những ứng dụng tự thiết kế giao diện thanh toán, không sử dụng giao diện hiển thị của Appota SDK).

Parameters:

- cardCode: Mã thẻ
- cardSerial: Số sê-ri thẻ
- cardVendor: Nhà cung cấp. Hiện tại hỗ trợ:
        vinaphone: Thẻ Vinaphone
        mobifone:  Thẻ Mobifone
        viettel:       Thẻ Viettel
        fpt:           Thẻ FPT Gate
        mega:       Thẻ MegaCard  
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeCardPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức thẻ cào.

Parameters:

- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeBankPaymentWithAmount:(float) amount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức internet banking với giá tiền cho trước.

Parameters:

- amount: Giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeBankPaymentWithListAmount:(NSArray*) listAmount withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức internet banking với danh sách giá tiền cho trước.

Parameters:

- listAmount: Danh sách giá tiền
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeBankPaymentWithState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức internet banking cho phép người dùng tự nhập số tiền.

Parameters:

- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeApplePaymentWithItem:(AppotaAppleIAPItem*) item withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức Apple Payment với một IAP item cho trước.

Parameters:

- items: IAP Item
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch

(void) makeApplePaymentWithListItem:(NSArray*) lisItem withState:(NSString*) state withTarget:(NSString*) target withNoticeUrl:(NSString*) noticeUrl withDescription:(NSString*) description withCompletionHandler:(AppotaPaymentHandler) handler

Hiển thị giao diện thanh toán sử dụng phương thức Apple Payment với danh sách IAP item cho trước.

Parameters:

- item: Danh sách IAP items
- state: Chuỗi state tùy biến cho dev gửi lên
- target: Chuỗi target tùy biến cho dev gửi lên
- noticeUrl: URL được gọi khi kết thúc giao dịch
- description: Mô tả chi tiết cho thanh toán
- handler: Handler được gọi đến khi kết thúc khởi tạo giao dịch