-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev] adicionado doc no README.md e ajustes na classe FinishAcivity e…
… MposService
- Loading branch information
1 parent
fae84ed
commit d9f8d27
Showing
10 changed files
with
336 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,94 @@ | ||
# cordova-plugin-pagarme-mpos | ||
# cordova-plugin-pagarme-mpos | ||
|
||
## Uso | ||
|
||
###### Pagamento com fluxo em interface nativa (ANDROID) | ||
|
||
```js | ||
pagarme.Mpos.payWithInterface({ | ||
encryptionKey: string, | ||
amount: string, | ||
remoteApi: { | ||
url: string, | ||
type: 'POST'|'PUT'|'PATCH', | ||
headers: { | ||
}, | ||
params: { | ||
} | ||
} | ||
}, function (success) { | ||
console.log(success); | ||
}, function (error) { | ||
console.log(error); | ||
}); | ||
``` | ||
|
||
###### Usando as funções da SDK do pagar.me | ||
|
||
```js | ||
pagarme.Mpos.initialize({ | ||
encryptionKey: string, | ||
enableSafeTransactionConditions: true, // default false | ||
alwaysUpdateTables: false, // default true | ||
remoteApi: { | ||
url: string, | ||
type: 'POST'|'PUT'|'PATCH', | ||
headers: { | ||
'X-FOO': 'bar' | ||
}, | ||
params: { | ||
foo: 'bar' | ||
} | ||
} | ||
}, function(success) { | ||
console.log(success); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.getConnectedPinPad(function(data) { | ||
console.log(data); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.listDevices(function(success) { | ||
console.log(success.devices); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.connectPinPad({ | ||
macAddress: pinPad.macAddress | ||
}, function(data) { | ||
console.log(data); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.disconnectPinPad(function(success) { | ||
console.log(success); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.pay({ | ||
amount: string, | ||
paymentMethod: pagarme.Mpos.PAYMENT_METHOD_CREDIT_CARD, // pagarme.Mpos.PAYMENT_METHOD_DEBIT_CARD | ||
}, function(success) { | ||
console.log(success); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.downloadTables({ | ||
forceUpdate: true, | ||
feedbackMessage: "atualizando dados..." | ||
}, function(success) { | ||
console.log(success); | ||
}, function(error) { | ||
console.log(error); | ||
}); | ||
|
||
pagarme.Mpos.display("transacao Aprovada") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.