Skip to content

Commit

Permalink
Merge pull request #5 from omise/feature/remove-vault-config
Browse files Browse the repository at this point in the history
Remove vault url config on Omise.js client
  • Loading branch information
tommy-omise committed Mar 23, 2015
2 parents 522a719 + 8bb601d commit 0e15a1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions assets/javascripts/omise-myaccount-card-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
}else{
hideError();
if(Omise){
Omise.config.defaultHost = omise_params.vault_url;
Omise.setPublicKey(omise_params.key);
Omise.createToken("card", card, function (statusCode, response) {
if (statusCode == 200) {
Expand All @@ -107,7 +106,9 @@
}, "json"
);
} else {
if(response.responseJSON && response.responseJSON.message){
if(response.message){
showError( "Unable to create a card. " + response.message, $form );
}else if(response.responseJSON && response.responseJSON.message){
showError( "Unable to create a card. " + response.responseJSON.message, $form );
}else if(response.status==0){
showError( "Unable to create a card. No response from Omise Api.", $form );
Expand Down Expand Up @@ -141,4 +142,4 @@
create_card();
});
}
)(jQuery);
)(jQuery);
7 changes: 4 additions & 3 deletions assets/javascripts/omise-payment-form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
}else{
hideError();
if(Omise){
Omise.config.defaultHost = omise_params.vault_url;
Omise.setPublicKey(omise_params.key);
Omise.createToken("card", card, function (statusCode, response) {
if (statusCode == 200) {
Expand All @@ -105,7 +104,9 @@
$( '#omise_card_security_code' ).val("");
$form.submit();
} else {
if(response.responseJSON && response.responseJSON.message){
if(response.message){
showError( "Unable to process payment with Omise. " + response.message );
}else if(response.responseJSON && response.responseJSON.message){
showError( "Unable to process payment with Omise. " + response.responseJSON.message );
}else if(response.status==0){
showError( "Unable to process payment with Omise. No response from Omise Api." );
Expand Down Expand Up @@ -147,4 +148,4 @@
$( '.omise_token' ).remove();
});
})
})(jQuery)
})(jQuery)
4 changes: 2 additions & 2 deletions omise-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Plugin Name: Omise Gateway Wordpress plugin
* Plugin URI: http://docs.omise.co/omise-wp
* Description: Allows easy integrating the Omise Payment gateway
* Version: 1.0
* Version: 1.0.2
* Author: Omise Team
* Author URI: https://www.omise.co
* License: Copyright 2014. Omise Co.,Ltd.
Expand All @@ -14,7 +14,7 @@
define("OMISE_PROTOCOL_PREFIX", "https://");
define("OMISE_VAULT_HOST", "vault.omise.co");
define("OMISE_API_HOST", "api.omise.co");
define("OMISE_WOOCOMMERCE_PLUGIN_VERSION", "1.0.1");
define("OMISE_WOOCOMMERCE_PLUGIN_VERSION", "1.0.2");

require_once 'omise-util.php';
require_once 'omise-api-wrapper.php';
Expand Down

0 comments on commit 0e15a1c

Please sign in to comment.