載入ACpay最新SDK (2023/08 update v1.0.3)
將申請之相關參數設置完成以使用SDK
名稱(*=必填) | 類別 | 內容 |
appID* | int | 驗證識別碼 |
appKey* | String | 驗證金鑰 |
serverType* | String | 使用的伺服器種類: |
ACconnect.card.setup({
fields: {
number: {
element: '.form-control.card-number',
placeholder: '**** **** **** ****'
},
expirationDate: {
element: document.getElementById('acpay-expiration-date'),
placeholder: 'MM / YY'
},
ccv: {
element: '.form-control.cvc',
placeholder: '安全碼'
}
},
styles: {
'input': {
'color': 'gray'
},
'input.ccv': {
'font-size': '16px'
},
':focus': {
'color': 'black'
},
'.valid': {
'color': 'green'
},
'.invalid': {
'color': 'red'
},
'@media screen and (max-width: 400px)': {
'input': {
'color': 'orange'
}
}
}
})
依照店家使用需求取得 api 回傳 Prime並進行後續交易授權所需處理。
//Pass the callback function as an argument and you will get the prime string
ACconnect.card.getPrime(function (result) {
if (result.status !== 0) {
alert('get prime error ' + result.msg);
return
}
alert('get prime 成功,prime: ' + result.card.prime);
})
取得Prime 及當前交易資訊對ACpay進行交易授權請求。(詳細請見網路特店暨線上授權服務系統 付款服務使用手冊)
PRIME Mode